1
$\begingroup$

Is there a novel way to create a low-pass filter (Finite Impulse Response Filter) with varying cut off frequency over time?

For example, I have a white noise that is 10 seconds long sampled at 44.1 kHz. I want to create a low-pass filter that will have a varying cut-off frequency over time. At time 0 my cut-off frequency would be 100 Hz and will decrease linearly down to 1 Hz at time 10 seconds.

$\endgroup$
  • $\begingroup$ A system doesn't have to be time-invariant, so yes, you can build something like this. However, you must pay a bit of attention to the effects of a changing system. Can you explain what you need this for? I have several approaches in mind (from adjusting coefficients in a single-tap IIR over evolving a complete FIR through basically an adjustable IF with a fixed bandpass filter and a Hilbert transformator); whether any of these help you is unclear! $\endgroup$ – Marcus Müller Jun 8 at 17:53
  • $\begingroup$ Hi Marcus, I will use this to obtain an impulse response. Here is the process that I want to implement to produce an impulse response that I need. 1. Create 10 seconds white noise sampled at 44.1 kHz. 2. Apply exponential decay on the white noise such that the amplitude at time 10 seconds is near zero. 3. Apply a low-pass filter with varying cut-off frequency over time. I will convolve this derived impulse response in a human voice or a music. What do you think is best suited method in my case? $\endgroup$ – Joseph Roxas Jun 9 at 9:27
  • $\begingroup$ Why do you want to do that, or to which end? What's the purpose of the convolution of voice or music with this? $\endgroup$ – Marcus Müller Jun 9 at 21:53
0
$\begingroup$

I wouldn't call this novel but... I'm going to give an example on how to do this for a specific filter with a specific discretization.

A 1st order butterworth low-pass filter is given by:

$H(s) = \frac{Y(s)}{X(s)} =\frac{\omega_c}{s + \omega_c}$

Where $\omega_c$ is the cut-off frequency of the filter.

The backward difference (aka backward euler) approximation is given by:

$s \approx \frac{1-z^{-1}}{T_s}$

Where $T_s$ is the sampling time. By substitution, the discrete transfer function becomes:

$H(z) = \frac{Y(z)}{X(z)} \frac{\omega_c}{\frac{1-z^{-1}}{T_s} + \omega_c} = \frac{\frac{\omega_c \cdot T_s}{1+\omega_c\cdot T_s}}{1 - \frac{1}{1+\omega_c\cdot T_s}\cdot z^{-1}}$

Let $a = \frac{\omega_c \cdot T_s}{1+\omega_c\cdot T_s}$, then:

$H(z) = \frac{a}{1 - (1-a)\cdot z^{-1}}$

Thus the difference equation is: $y[n] = a\cdot x[n] + (1-a)\cdot y[n-1]$

Why go through the tedious process of getting an equation for $a$ when I could have just used the above formula and try to guess some values for $a$? Well, now if you want to change the cut-off frequency $\omega_c$ in real time, you simply have to recalculate $a$ each time you compute the signal. This, of course, assumes you have a constant sampling period.

Note that this filter is an IIR filter, not FIR as you requested, but the logic is basically the same: as long as you know how your coefficients relate to the cut-off frequency, then you just simply have to recalculate them every time you want a different cut-off frequency. Nothing stops you from repeating the same steps for different discretization methods, different types of filters, etc...

You may even wish to work purely in the discrete-time domain, but the relevant part is always knowing how your coefficients relate to the cut-off frequency.

$\endgroup$
  • 2
    $\begingroup$ I hope I'm not too pedantic, but there's no 1st order Butterworth, or Chebyshev, or Cauer, 1st order is universal. $\endgroup$ – a concerned citizen Jun 9 at 6:38
  • $\begingroup$ @aconcernedcitizen My knowledge of signal processing has always been kind of ad hoc so I never realized that, oops! $\endgroup$ – Chi Jun 9 at 15:49
  • $\begingroup$ Please also see dsp.stackexchange.com/a/54088/41790 and related posts by @Matt L. $\endgroup$ – Ed V Jul 9 at 12:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.