14 votes
Accepted

Which order to perform downsampling and filtering?

You need to filter first and then downsample. Otherwise, you will run into aliasing problems. I.e. frequencies that are above 30 Hz will create images within your frequencies of interest. You can ...
9 votes
Accepted

Is there an adjective describing a filter with kernel that has zero mean?

"Zero-Mean" is the word that's commonly used to describe signals and signals with a zero average. "This is a zero-mean filter." If you really mean a filter that is specifically ...
8 votes
Accepted

SOS-matrices' order does not correspond to given parameter when designing bandpass with scipy.signal.butter

Your expectations are reasonable. However, the definition of order in the design routine is confusing. It's the same in Matlab/Octave. For lowpass or highpass ...
  • 81k
7 votes
Accepted

How is the lowpass to bandpass transformation derived?

In the $s$-domain, the LPF-to-BPF transformation doubles the order of the filter. that is because the LPF has one transition from passband to stopband, but the BPF has two such transitions. Remember ...
7 votes

Frequency Domain Filtering

This is just "faking" the magnitude response of an IIR filter. The output's magnitude spectrum looks just like it has been filtered by the IIR filter with the given frequency response. Although it may ...
  • 4,125
6 votes
Accepted

Real and complex low pass equivalent of band-pass signal

It's not true that any real-valued band pass signal can be written as shown in your first equation: $$s(t)=A(t)\cos(\omega_c t)\tag{1}$$ The most general representation of a real-valued band pass ...
  • 81k
6 votes

FIR filter Gain of 0dB at Passband Frequency

FIR coefficients are $h[n]$, the same as the impulse response. there are $N$ non-zero taps. $$ h[n] = 0 \qquad \text{for } n<0, n \ge N $$ frequency response is $$\begin{align} H(e^{j \omega}) &...
6 votes

Numerically Stable IIR filter

First of all, what is the order of your IIR filter? The highest order I have ever used was an order-10 IIR filter for a control loop application. I feel like it is unlikely that you need more that ...
  • 3,670
6 votes

Why must the order of a Band-Pass and Notch filter always be even?

In principle there is no reason why the filter order of a general bandpass or bandstop filter must be even. Such a restriction is a consequence of a specific design procedure. In classic IIR filter ...
  • 81k
5 votes
Accepted

Frequency Domain Filtering

This sort of filtering is done all the time, but it doesn't have the effect you think it should. Suppose you have an IIR filter with an impulse response of $h[n]$ which is represented in the $z$ ...
  • 23.1k
5 votes
Accepted

Problems with implementation of a band-stop filter on an MCU (dsPIC) using fixed-point arithmetic

The denominator (recursive coefficients Ai) look OK: the poles of your system are at 45 degree angles ($\pi/4$), with magnitude 0.68 (which is not very aggressive for a notch filter; in my opinion ...
  • 4,761
5 votes
Accepted

Bandpass filters with python for low frequencies

I would bet this is just numerical error in the transfer function. Try using butter_sos = butter(..., output='sos') instead of ...
  • 15.1k
5 votes
Accepted

Design narrow bandpass filter for signal with high sampling rate

So, first, to put things into perspective: 4kHz is not a high sampling rate these days (add 5 orders of magnitudes, and things become hard). Your 15 kHz passband doesn't say anything about the ...
5 votes
Accepted

How to filter out everything but a single frequency in the time domain?

Depending on the exact characteristics of the signal and implementation requirements (if any) I can think of a number of approaches to extract content at a "single" frequency. The most common: Apply ...
5 votes

Matlab `filtfilt` provides excessive transient

It must have to do with the initial conditions used by the function filtfilt.m. The idea is to match initial conditions in a way such that startup and end ...
  • 81k
5 votes
Accepted

Derivation of the lowpass to bandpass transformation

You're right that the multiplication of a low pass and a high pass filter results in a band pass filter, as long as the cut-off frequency of the low pass is higher than the cut-off frequency of the ...
  • 81k
5 votes

Filter odd or even harmonics with notch or inverse notch filter

What you are looking for are what we, in the audio space, call comb filters. Comb filters may or may not have a feedback path, just like FIR and IIR filters. In fact, there is a generalized theory ...
5 votes
Accepted

Passband filter with 0.3 to 0.9 Hz passband on signal filtered at 100 Hz

The steeper something is in the frequency domain the more spread out it will be in the time domain. roughly speaking if you want a transition band of 0.1Hz width with a sample rate of 100Hz you'll ...
  • 34.2k
4 votes
Accepted

How to test digital filters?

Some thoughts on it at least. First, if you can shown linearity and time-invariance and you know that the filter has the correct impulse response you are home. Given that the filter is stable. So in ...
  • 772
4 votes
Accepted

The reasons for filter explosion

Basically you never want to use the Transfer Function representation (with b and a) and rather use the Zeros-Poles-Gain (...
  • 10.7k
4 votes
Accepted

From lowpass to bandpass

You just shifted the low pass filter to the right, so you generated a complex-valued filter, as you've observed. Multiplying a real-valued impulse response with a complex exponential naturally results ...
  • 81k
4 votes

Which order to perform downsampling and filtering?

Since I can't comment on this particular site I'd say this, consider the following before you do what you're trying to do. Due to the Nyquist law you want your sampling frequency to be that of the ...
  • 141
4 votes
Accepted

Bandpass filter to get EEG frequency bands?

As the frequency bands are simple frequency ranges, I wonder if I can use several bandpass filters to get them (instead of using WPT / FFT)? Sure! That's how it's usually done! Is there any ...
4 votes
Accepted

Does a linear phase FIR filter shifted in frequency preserve linear phase?

The generalized linear phase FIR filter has the following frequency response: $$H(\omega) = A(\omega)~e^{j (\alpha \omega + \beta)}$$ for some constant $\alpha$ and $\beta$ and $A(\omega)$ being real....
  • 27.1k
4 votes
Accepted

Passband vs Baseband Bandwidth

You can unify the definitions for baseband and passband bandwidths by saying that bandwidth is only measured at positive frequencies. So for low pass signals, the lower frequency is zero and the upper ...
  • 81k
4 votes
Accepted

Quadrature component - condition on equivalent lowpass signal

Your idea with the Hilbert transform doesn't work. The only signal (apart from $x(t)=0$) for which the Hilbert transform is zero, is a constant signal. A band pass signal $x(t)$ can be written in ...
  • 81k
4 votes

Filter odd or even harmonics with notch or inverse notch filter

If the OP is actually interested in selecting only one individual frequency from the even or odd harmonics, then a moving average filter (MAF) would be ideal since this can provide a null at every ...
  • 38.4k
4 votes
Accepted

What is the relationship among digital filter cutoff frequency, signal frequency and filter settling time?

With "Settling Time" we can consider the overall time delay of the filter, and the rise/fall time of a transient change going through the filter. The rise/fall time will inversely related to ...
  • 38.4k
3 votes
Accepted

Tradeoff between Filter Order and Sections

Large order single stage filters are inherently problematic. Calculating the numerators and denominator from the poles and zeros is an ill defined problem and numerically unstable. Furthermore Direct ...
  • 34.2k
3 votes

The reasons for filter explosion

The higher the order, the more poles that need to be fit around a small semi-circular-like ring, and right at the edge of the unit circle. The smaller the ratio of the filter's frequency to the ...
  • 34.1k

Only top scored, non community-wiki answers of a minimum length are eligible