Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Altera_Forum
Honored Contributor I
1,488 Views

FIR compiler II parameter settings for sample rates below 1Mhz

Hello, 

i am trying to set the FIR Compiler II parameters to accomplish the following operation. 

 

interpolation factor: 5 

decimation factor: 2 

channels: 6 

 

input sample rate ( per channel) 260ksps 

 

the data is arriving from an Avalon source stream which is being clocked at 25Mhz 

(the ratio of data arrival over the Avalon channel to dead time works out to the net per channel data rate of 260k 

 

this results in an output sample rate of 650ksps, the total bandwidth required is therefore 3.9msps for all six channels. I have derived the fir taps from matlab and set the LPF cutoff freq to be 33khz. 

 

so I have a few questions which are not clear from reading the fir compiler manual or viewing the online tutorials. 

 

1) can numbers less than one I.e.real values be entered in for sample rate? In this case 0.260? 

2) does the sample rate entry apply to the input sample rate, the resultant output sample rate, or something else in the case of multichannel, multi rate filters? 

3) will the fir work correctly if the ratio from clock frequency to sample rate is not an integer, I.e. Arbitrary real number greater than total aggregate sample rate. In this case 25mhz/1.3mhz = 19.23 or in the case of output rate 25mhz/(0.650*6)= 25mhz/3.9mhz= 6.41 

 

thanks in advance. 

richard
0 Kudos
6 Replies
Altera_Forum
Honored Contributor I
27 Views

 

--- Quote Start ---  

 

 

interpolation factor: 5 

decimation factor: 2 

channels: 6 

 

input sample rate ( per channel) 260ksps 

 

the data is arriving from an Avalon source stream which is being clocked at 25Mhz 

(the ratio of data arrival over the Avalon channel to dead time works out to the net per channel data rate of 260k 

 

this results in an output sample rate of 650ksps, the total bandwidth required is therefore 3.9msps for all six channels. I have derived the fir taps from matlab and set the LPF cutoff freq to be 33khz. 

 

so I have a few questions which are not clear from reading the fir compiler manual or viewing the online tutorials. 

 

1) can numbers less than one I.e.real values be entered in for sample rate? In this case 0.260? 

2) does the sample rate entry apply to the input sample rate, the resultant output sample rate, or something else in the case of multichannel, multi rate filters? 

3) will the fir work correctly if the ratio from clock frequency to sample rate is not an integer, I.e. Arbitrary real number greater than total aggregate sample rate. In this case 25mhz/1.3mhz = 19.23 or in the case of output rate 25mhz/(0.650*6)= 25mhz/3.9mhz= 6.41 

 

thanks in advance. 

richard 

--- Quote End ---  

 

 

1) You enter your fractional rate as integer interpolation of 5, and integer decimation of 2.  

The actual fraction result is implied as 5/2 = 2.5 (what is 0.26 you mentioned?) 

 

2) Normally the tool wants input rate. 

 

3) yes, the ip will generate valid out signal to flag valid samples and non valid ones. You will enter clock rate somewhere. 

 

your cut off of 33KHz may be too tight. You may be cutting off your own signal. You only need to cut off from edge of first image centred on 260*2 kHz or half of output Nyquist (650KHz) whichever is more restrictive. The filter works in the fast domain of 5 * 260 = 1300KHz
Altera_Forum
Honored Contributor I
27 Views

No, the 33khz cutoff is as desired. There are a number of reasons related to the hardware design and signal flow that results in a per channel sample rate of 260ksps. However, the signal of interest is band limited to <= 33khz. There are also technical reasons why I want the output rate to input rate to be the specified ratio of 2.5, 

 

The fractional filter rate is not the same as input sample rate and only relates output sample rate to input sample rate. As I mentioned, the Avalon input stream is carrying six time multiplexed channels with the Avalon stream clocking at 25mhz with a per channel sample rate of 260ksps in which the signal of interest lies below 33khz. Thus the Avalon data valid input line only is asserted periodically consistent with the multiplexed data input rate. Additional decimation takes place after the fir and I don't want aliasing to occur after the subsequent decimations which is why the 33khz cutoff is required. 

 

You seem to have missed my point on question 1. The filter requires input in the multi rate case for clock rate, interpolation, decimation, AND sample rate. The clock rate, interpolation and decimation values are as indicated (25Mhz, 5 and 2 respectively.) what I wanted to know is if the filter will function correctly if I input the sample rate value as 0.26 since the manual indicates that the sample rate input is expected to be in units if MHz and my input sample rate is 260khz per channel. This results in a real number which is less than 1 and the manual also implies that the input needs to be an integer in that field. Hope this explains my confusion.
Altera_Forum
Honored Contributor I
27 Views

The tool should only know the ratio of clock to sample rate. It would be silly if it doesn't. I tried with fir compiler and entered fractions for clock and sample rate and was accepted though it says MHz in brackets.

Altera_Forum
Honored Contributor I
27 Views

Right. The documentation and user interface are not clear on this. I have also noticed that under some circumstances the frequency response plot is not computed correctly even though the impulse response is showing the correct values for the taps values entered. The documentation also doesn't make it clear that the frequency plot nyquist value is determined by the output sample rate in the case of multi rate filters. I guess I should have realized this when inspecting the plots, but since the frequency response plot was bad, I didn't know what was going on.

Altera_Forum
Honored Contributor I
27 Views

On the issue of cutoff point. If your signal extends from 0 to 33KHz and there is no unwanted power outside 33KHz then aliasing will not occur if your cutoff is 520 - 33 = 487KHz 

The filter works at 1300Khz so your cutoff ratio becomes 487/1300. your passband will be 33Khz and transition band from 33 to 487 

 

If you cutoff at 33KHz sharp then that requires a ratio of 33/1300 and makes a big difference. The Nyquist will be 650Khz at output so 487 will stop any aliasing.
Altera_Forum
Honored Contributor I
27 Views

Once I came to understand that the filter taps need to be determined for the output of the interpolation stage everything started to make sense. That particular bit isn't spelled out anywhere in the documentation. The matlab model was also helpful to get a handle on the operation of the filter. Inspecting the matlab model makes it clear that the filter is applied afte interpolation, and the final decimation is just subsampling, which assumes any aliasing issues have already been addressed by the filter cutoff frequency that preceded. 

 

So ive got it nailed down now. Thanks for you feedback.  

 

Richard
Reply