If I use the resample function to downsample a 1024hz EEG signal (which has already been high-pass filtered at .5 hz and lowpass filtered at 256hz) to a sampling rate of 256hz will this lead to nontrivial aliasing?
10 views (last 30 days)
Show older comments
I want to check whether our EEG preprocessing pipeline might be introducing non-trivial amounts of aliasing when we use the resample function to downsample our signal from 1024hz to 256hz. Here is the order of the preprocessing steps of interest:
- Raw 1024Hz signal is high-passed at .5 Hz
- The signal is then lowpassed at 256 Hz
- The signal is then resampled to a sample rate of 256Hz
My concern is that before step 3 (i.e. resampling) the signal contains frequencies well above the nyquist frequency of the new target sample rate (i.e. new target sample rate is 256Hz so nyquist would be 128 Hz, but the signal contains frequencies up to 256hz). So my thinking is that if resample were purely a downsampling function then this would likely lead to aliasing, but the resample function documentation says that a polyphase anti-aliasing filter is utilized before downsampling. I don't know much about polyphase anti-aliasing filters so I am wondering if it is safe to assume that this anti-aliasing filter implemented in the resample function will prevent aliasing when resampling from 1024Hz to 256Hz even when the signal contains frequencies above 128Hz?
Here is an example of the syntax we use to run the resample function:
y = resample(1024Hz_signal_vector, 256, 1024)
Thanks!
2 Comments
Mathieu NOE
on 18 Jan 2021
hello
to proprerly define how one should low pass filter and resample the data , you have to look first at the amplitude of the raw data in the original frequency range (Fs = 1024). then you have to define a low pass filter that ensures that the remaining signal amplitude at and above the new sampling rate nyquist frequency (so here Fnyq = 128 Hz) is much lower than the amplitude in the 0 - 128 Hz range. So above 128Hz, the spectrum should be at least - 40 dB below the typical spectrum amplitude in the 0 - 128 range. I believe this has not been corretly addressed in your case.
also if you do resampling with an integer factor between the original and new sampling frequency, I would recommend to use decimate , which includes also an antialiasing filter (By default, decimate filters the data with an 8th order Chebyshev Type I lowpass filter with cutoff frequency .8*(Fs/2)/R, before resampling.
To validate that the built in antialiasing filter is good enough, plot the original spectra and the decimated data overlaid in the same graph
Answers (0)
See Also
Categories
Find more on Multirate Signal Processing in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!