# What is the difference between the sampling frequency of signal and sampling frequency of filter

I believe that there is no connection between the sampling frequency used for converting an analogue filter to digital filter and the one used to sample a signal that the filter will be used on. But I would like to confirm this from someone who knows.

I like to confirm that sampling frequency(e.g when using bilinear or impulse invariance method) used to convert analogue to digital filter can be chosen independent of the sampling frequency used to record analogue to digital signal. E.g. can an analogue filter converted to its digital equivalence using the bilinear transform at 100 Hz be used to filter a digital signal sampled at 1000 Hz?

• But that will shift the frequency of the filter. So if you design a filter for fs of 100 Hz to remove everything below 10 Hz, then the same filter applied for fs 1000 Hz will remove everything below 100 Hz. When filters are being designed we are using normalised frequencies - normalised by fs. – jojek Feb 1 '18 at 21:15
• I know that the frequency response of the filter will depend on the signal sampling frequency. But when converting an analogue filter to digital, the filter is also sampled at a rate, fs. The bilinear transform method says fs is just an arbitrary constant. The impulse invariance method says fs needs to be high enough to avoid filter frequency response aliasing. Unless am getting completely confused, my guess is that fs is different from Fs used to sample the signal and serve to correctly digitize an analogue filter. – Chika Feb 2 '18 at 7:01

I sadly don't have the reputation to comment on Fat32's answer, but let me try to answer directly instead: the frequency response of a digital filter is always relative to the processing sampling rate.

So if you design a filter with cutoff at 100Hz and 1kHz sampling rate, then you are really designing for a normalized cutoff frequency $$f/f_s$$ of 1/10 and whatever the processing rate (ie. the sampling rate of the processed signal), the cutoff will always be 1/10 times the processing rate. If you design a similar filter with cutoff at 200Hz and 2kHz sampling rate, then you will get the same filter.

Now, if you want to filter a signal sampled at 1kHz and you want the cutoff to be 100Hz, then you need to design a filter with a normalized cutoff frequency of 1/10. If you use the same filter on a signal sampled at 2kHz, then the cutoff will be at 200Hz. If you want to keep the cutoff at 100Hz for the 2kHz signal as well, then you need a different filter, this time for a (normalized) frequency of 1/20 instead.

The filter coefficients don't carry any information about the sampling rate, but rather everything is always relative to the sampling rate of the signal you are filtering and this applies to all digital filters, whatever the design method and whether FIR and IIR.

• Correct but perhaps you are too loose with your language as the frequency response is a fixed characteristics (not relative to Fs) which have different number representations when converted to Hz. Nevertheless I notice that my question is not being answered as I was referring to bilinear or impulse invariance methods of converting analogue to digital filters where there are two different sampling rates, one for filter and the other for signal. – Chika Jan 11 at 19:18
• The frequency response of a digital filter (after the design is done) is always relative to the sampling rate at which you process the filter. The original analog prototype might not be relative to any given sampling rate, but after you digitize the filter there is no more "Hz" but only frequencies relative to whatever sampling rate you are processing at. If you want "Hz" you need to design for whatever sampling rate you plan on processing at. – myzz Jan 13 at 4:24
• If what you are saying is that there is no connection between the frequency used to convert an analogue filter to digital filter, then could you put it bluntly. As per the terminology, I still insist that your description of frequency response explicitly involving Fs does not seem general. I would change your statement slightly thus: "The frequency axis of frequency response of a digital filter is always scaled by Fs" – Chika Jan 13 at 23:19

Let's assume you work with a FIR filter, so you, in general, will just convolute a signal and an impulse response of the filter. Below you can find a C-code snippet for such a convolution.

#define L (4) //filter lenght
int FIR(int a)
{
static int i=0, reg[L]; //current position and  input signal
static const int h[L]={1,1,1,1}; //impulse response
int b=0;//output signal
reg[i]=a; //a first input value is a first output value
for(int j=0;j=L-1;j++) //convolution
{
b=b+h[j]*reg[i];
i=(i-1)&(L-1);
}
i=(i+1)&(L-1); //go to the next input
return b;
}

You can call this procedure with a 'filter sampling rate' T<=4t, where t - is a 'signal sampling rate'. The example above is just for an illustration of the idea. (It is just moving average with four points, therefore you could do the same much easier). In order to simulate analogue signal as accurate as you can with a given sampling rate, T have to be equal to t.

There is a relation between those two sampling frequencies. Let's assume you want to design a digital lowpass filter $h[n]$ from an analog prototype lowpass filter $h(t)$ by the method of impulse invariance.

Assume that the analog lowpass filter has a cutoff frequency of $f_c$ in Hz. Then you must use a filter sampling frequency, $f_{sf}$, that's at least twice greater than this $f_c$ to avoid aliasing in the resulting digital filter's spectrum.

After you've obtained the digital filter $h[n]$, its corresponding cutoff frequency in discrete-time frequency will be: $$w_c = 2\pi \frac{f_c}{f_{sf}}$$

Forex. with $f_c = 1$ kHz and $f_{sf} = 4$ kHz, then the cutoff frequency of $h[n]$ will be $w_c = \pi / 2$

When this filter is used within a DSP system where the input signal is sampled at $f_{ss}$ Hz, then the effective analog cutoff frequency of the digital filter will be $$f_{ec} = \frac{\omega_c}{2\pi } f_{ss}$$ Hz. For the above example if you select a signal sampling frequency of $f_{ss} = 10$ kHz, then the effective analog cutoff frequency will be: $$f_{ec} = \frac{\pi/2}{2\pi } 10k = 2.5 \text{kHz}$$

Therefore there is a two stage process of finding the actual effective frequency. In order to avoid this two stage projection of the sampling frequencies on the actual frequencies, it's better to start by the specifications of the digital filter in the digital domain such as the required cutoff frequency $\omega_c$ and then project this into the analog filter prototype design, at an arbitrary filter sampling frequency $f_{sf}$. Then the resulting digital filter will always have the requested digital cutoff frequency $\omega_c$ and will behave based only on the signal sampling frequency $f_{ss}$ as expected.

• From you explanation I do not see how the filter sampling frequency is related to the signal sampling frequency. The filter frequency is chosen to avoid filter frequency response aliasing. While the signal sampling frequency is chosen to avoid signal spectrum aliasing. These sampling frequencies seem to be chosen independently. the reason one thinks about the signal sampling frequency when designing filter is because of the filter cyclic cutoff frequency but not the filter sampling frequency. Am I missing something? – Chika Feb 11 '18 at 12:04
• In the case of the bilinear method filter aliasing does not exist; so can we not theoretically make the filter sampling frequency anything when using bilinear method? – Chika Feb 11 '18 at 12:04