long time reader, first time poster. I have a few very simple questions that are troubling me and I am hoping that one of you guys can help me out.
Setup & Aim: I have a time series that I want to downsample, and I simply want to run a low pass filter on it before doing so, to avoid aliasing. I am using Python (SciPy) but it looks like Matlab behaves similarly, neither are really relevant for these questions.
My original time series is sampled at 0.5ms (2000Hz, fNyquist=1000Hz) and I want to resample to 2ms (250Hz, fNyquist=250Hz), so I must apply an anti-alias filter that cuts off any frequencies > 250Hz, and then downsample. So far, so good.
In Python, it looks like a Butterworth Filter is the way to go, which requires a normalised frequency (Wn). My understanding is that in my case Wn = 250Hz/1000Hz = 0.25.
Now, what I don't understand and I cannot find any information on, is as follows: what if my original time series (fs=2000Hz) had been upsampled from 1ms (fs=1000Hz, fNyquist=500Hz)? There is no extra information between 500 and 1000Hz but I don't necessarily know that and I apply a Butterworth Filter with Wn = 0.25 (instead of Wn = 0.5 for 1ms sampling). Is it an issue? Am I misunderstanding how a Butterworth filter works?
My second question is something like "Why is this the preferred implementation of a low pass filter?" I am sure there are good reasons but I have used software in the past to just high cut filter my data knowing my new fNyquist, so in my case. So in my case I would use something like 0-0-200-250Hz. Again, what am I missing?
Finally, one of the roots of my problem is that I sometimes have irregularly sampled data. I can run an interpolation to a regular time array but when doing this I tend to oversample, to avoid losing signal (This is where my first question comes in). Am I wasting my time? Should I just resample to the smallest time interval in my data?