0

Does downsampling using stream.resample () in Python introduce aliasing effect? I want to investigate a signal below 4 Hz. It has the original sampling rate of 100 Hz but I need to downsample it as much as possible. If I use In Python st.resample() based on the documentation (https://docs.obspy.org/packages/autogen/obspy.core.stream.Stream.resample.html) it does the resampling using a Fourier method. If I downsample to 8 Hz:

st.resample (8)
  • Will I have an aliasing effect considering that my interest frequency is below 4 Hz?

  • What if I set the no_filter to False:

    st.resample (8, no_filter=False)

OnEarth
  • 57
  • 1
  • 6

1 Answers1

1
  1. no aliasing will happen as this truncates and interpolates points in the frequency domain.
  2. using no_filter=False only reduces high frequency components, which only smooth the signal, it doesn't matter in terms of aliasing, you can think of it as smoothing after the resampling.
Ahmed AEK
  • 8,584
  • 2
  • 7
  • 23
  • Thanks for the answer. Isn't it like because I am downsampling exactly at Nyquist frequency then I could have an aliasing effect in the frequencies close to 4 Hz? – OnEarth Mar 21 '23 at 13:02
  • @OnEarth i am not sure if you are seeing something that you cannot explain and blaming aliasing for it, but no aliasing should happen, unless there's a bug in the function. the problem is likely elsewhere. – Ahmed AEK Mar 21 '23 at 13:11
  • Thanks a lot. Actually I dont have any problem with the data and I am pretty sure that there is no aliasing effect. But someone claims that just because you use a downsampling equal to the Nyquist frequency you could have an aliasing effect. I don't know how to convince her that I don't have an aliasing effect! – OnEarth Mar 21 '23 at 13:14
  • 1
    @OnEarth there will be aliasing if you do naive down-sampling by decimation and interpolation in the time domain, this isn't done by this function, so you don't have to worry about it, this function is smart enough not to introduce aliasing. – Ahmed AEK Mar 21 '23 at 13:16
  • Many thanks. So the way I should explain is that when we downsample in the time domain then we could have an aliasing effect, but when we downsample in the frequency domain (like what this function does ) we don't have an aliasing effect. Right? – OnEarth Mar 21 '23 at 13:19
  • @OnEarth sure, that sounds convincing enough. – Ahmed AEK Mar 21 '23 at 13:29