cic_analysis
This function computes and shows the frequency response of a CIC filter and then analyse the aliasing that occurs after decimation.
Namespace: dsp::filter
Prototype
CICAnalyse cic_analysis(const CICConfig &config, float Fin, float Fint=0)
Parameters
config | Main parameters of the CIC filter (see CICConfig) |
Fin | Input sample frequency |
Fint | Fréquence où mesurer l'atténuation |
Returns
A tuple with :
- Theorical transfert function (not taking into account the decimation),
- Number of additionnal bits needed to implement the CIC filter
Description
This functions draws two plots:
- The first plot shows the frequency response before decimation (both the global one, and one centered on the passband).
- The second plot shows the effect of the decimation (aliasing in the baseband).
Also, this function computes the number of additionnal bits needed to implement the filter in fixed point / integer arithmetic. This is computed as (see http://www.tsdconseil.fr/log/scriptscilab/cic/cic-en.pdf):
Example
// 10 MHz input sample frequency
Fin = 10e6;
// Decimation ratio = 16, 5 CIC stages
// (sample rate at output of CIC is 10 MHz / 16 = 625 KHz)
R = 16, N = 5, M = 1;
cic_analysis(R, N, M, Fin);