Skip to main content
Tweeted twitter.com/StackSignals/status/1438789871443890177
added 4 characters in body
Source Link

While working on an existing project, I came across a piece of code that does a decimation filter in a way that I find not obvious.

In this code, every 6th sample is being thrown away. The result is being fed to FFT functions, in order to calculate magnitudes of two particular frequencies. This is done to demodulate S-FSK messages.

My question is specifically about validity of such approach when only single Nth$N$th sample is being thrown away. Googling around yielded plenty of beginner-level articles on decimation filtering, which all suggested keeping a single Nth$N$th sample. This makes much more sense to me, since (assuming sufficient oversampling) keeping only a single sample periodically will not change an overall form of a sine wave.

On the other hand, in the implementation that I encountered the end result is a broken wave with phase changing all the time.

Granted, we don' care about the phase in this application, only the magnitude, but still, is this valid?

If yes, what are the drawbacks or potential side effects of such approach?

While working on an existing project, I came across a piece of code that does a decimation filter in a way that I find not obvious.

In this code, every 6th sample is being thrown away. The result is being fed to FFT functions, in order to calculate magnitudes of two particular frequencies. This is done to demodulate S-FSK messages.

My question is specifically about validity of such approach when only single Nth sample is being thrown away. Googling around yielded plenty of beginner-level articles on decimation filtering, which all suggested keeping a single Nth sample. This makes much more sense to me, since (assuming sufficient oversampling) keeping only a single sample periodically will not change an overall form of a sine wave.

On the other hand, in the implementation that I encountered the end result is a broken wave with phase changing all the time.

Granted, we don' care about the phase in this application, only the magnitude, but still, is this valid?

If yes, what are the drawbacks or potential side effects of such approach?

While working on an existing project, I came across a piece of code that does a decimation filter in a way that I find not obvious.

In this code, every 6th sample is being thrown away. The result is being fed to FFT functions, in order to calculate magnitudes of two particular frequencies. This is done to demodulate S-FSK messages.

My question is specifically about validity of such approach when only single $N$th sample is being thrown away. Googling around yielded plenty of beginner-level articles on decimation filtering, which all suggested keeping a single $N$th sample. This makes much more sense to me, since (assuming sufficient oversampling) keeping only a single sample periodically will not change an overall form of a sine wave.

On the other hand, in the implementation that I encountered the end result is a broken wave with phase changing all the time.

Granted, we don' care about the phase in this application, only the magnitude, but still, is this valid?

If yes, what are the drawbacks or potential side effects of such approach?

edited title
Link

Decimation filter that throws away every Nth$N$th sample, keeping multiple samples: is it valid?

Source Link
ZenJ
  • 141
  • 2

Decimation filter that throws away every Nth sample, keeping multiple samples: is it valid?

While working on an existing project, I came across a piece of code that does a decimation filter in a way that I find not obvious.

In this code, every 6th sample is being thrown away. The result is being fed to FFT functions, in order to calculate magnitudes of two particular frequencies. This is done to demodulate S-FSK messages.

My question is specifically about validity of such approach when only single Nth sample is being thrown away. Googling around yielded plenty of beginner-level articles on decimation filtering, which all suggested keeping a single Nth sample. This makes much more sense to me, since (assuming sufficient oversampling) keeping only a single sample periodically will not change an overall form of a sine wave.

On the other hand, in the implementation that I encountered the end result is a broken wave with phase changing all the time.

Granted, we don' care about the phase in this application, only the magnitude, but still, is this valid?

If yes, what are the drawbacks or potential side effects of such approach?