my Rf signal is 102.3 Mhz and it is fed to mixer and I need IF as 5Mhz so i set the local ocillator to 97.3Mhz to obtain the 5Mhz that is my IF.
I have to pass this IF through low pass filter and then decimation and obtain the same IF frequency as 5Mhz.
But my sampling frequency is 409.8Mhz for filter so i have to reduce to 20.49Mhz. so i have to decimate it by 20 then i will obtain the 20.49Mhz.
i am decimating in 2 stages 20(5x4).
first time i am using CIC filter and decimate by 5 to obtain 81.96Mhz. and then i will pass this new sampling frequency of 81.96 to Half band filter and decimate by 4 to obtain the 20.49Mhz.
I need matlab code for the filter and decimation process . and my IF frequency and decimation factor will changes so i need a general variable matlab code for the filters..
my paramets for the filter are
passband ripple = 0.0116 (0.1dB)
stop band ripple = 0.0316(30dB)
pass band is 10Mhz and stop band is 15 Mhz and new sampling frequency after decimation is 20.48.