0
\$\begingroup\$

In my system I measure signals with interesting bandwith from DC to 2 kHz. I have an analog low-pass filter with 200 kHz cutoff frequency in order to filter noise. The ADC samples the signal with 500 kHz. The signals are then used for a feedback controller that runs in a task with 20 kHz. So my questions are the following:

Can I expect alias on the signals used in the control task of 20 kHz?

Should in this case a digital filter at the sampling rate of 500 kHz applied that has a maximal cutoff frequency of 10 kHz (Half of control task rate)?

Would it be possible to apply a further low pass filter with 10 kHz cutoff frequency in the 20 kHz program task?

\$\endgroup\$
5
  • 1
    \$\begingroup\$ How much aliasing depends on filter order and resolution you need. A first order filter has 6dB per octave so it would have barely effect at 250kHz after which aliasing happens. So what kind of filter you have? \$\endgroup\$
    – Justme
    Sep 27 '20 at 21:46
  • 1
    \$\begingroup\$ When you re-sample the 500kHz input signal for use with 20kHz control task, there can be aliasing. So, just before passing the 500kHz sampled signal to control task, ensure via (digital or analogue) filtering that frequencies above 10kHz are well attenuated. \$\endgroup\$
    – AJN
    Sep 28 '20 at 1:19
  • \$\begingroup\$ @Justme : It is a first order analog LP filter. On the computer side, a digital filter is not yet implemented. \$\endgroup\$
    – Carlos
    Sep 28 '20 at 4:49
  • \$\begingroup\$ If it is a first order filter, see the comment from @Justme . There might not be enough attenuation at 250kHz from where the the aliasing starts. \$\endgroup\$
    – AJN
    Sep 28 '20 at 12:17
  • 1
    \$\begingroup\$ Indeed. Even if the RC filter 3dB point is set at 20kHz, the attenuation will only be 20dB at 200kHz. 20×log(0.1)=-20 dB. If the filter 3dB point is set at 2kHz, thats -40dB or 0.01 at 200 kHz. \$\endgroup\$
    – Justme
    Sep 28 '20 at 12:29
2
\$\begingroup\$

Can I expect alias on the signals used in the control task of 20 kHz?

Yes. The 500kHz signal could have have signals up to 200kHz in it. It would get aliased when re-sampled for feeding into 20kHz.

Should in this case a digital filter at the sampling rate of 500 kHz applied that has a maximal cutoff frequency of 10 kHz (Half of control task rate)?

Yes. You can have a digital anti-aliasing filter running at 500kHz sitting upstream of the 20kHz control task.

Would it be possible to apply a further low pass filter with 10 kHz cutoff frequency in the 20 kHz program task?

(Emphasis mine). By the time you are inside the 20kHz, task, the aliasing would have already occured. (Unless you passed multiple, consecutive samples of the 500kHz signal inside the task, in which case the information loss hasn't occured yet). So, the digital anti-aliasing filter should be sitting upstream of the task.

\$\endgroup\$
4
  • \$\begingroup\$ One approach is to pass 25 of the 500kHz samples to the 20kHz task, and compute their average (add them all and multiply by 1/25) in the 20kHz task. This is a crude but workable form of anti-alias filter, equivalent to a "Sinc filter". \$\endgroup\$ Sep 28 '20 at 12:25
  • \$\begingroup\$ Thanks for the comprehensive explanations. I control a motor with a PWM. Is the situation the same when the ADCs are triggered in such a way that only at the center of the high level of the PWM is measured? \$\endgroup\$
    – Carlos
    Sep 28 '20 at 14:29
  • \$\begingroup\$ What are you measuring ? The PWM voltage ? If you sample only at high of PWM, won't the ADC be measuring the same value (with some noise) always then ? I think more context is required to answer the question. Perhaps a new question with the details of the system. \$\endgroup\$
    – AJN
    Sep 28 '20 at 15:28
  • \$\begingroup\$ I measure the phase current of an electric machine. The PWM is for the input voltage. Yes, a new question may be better. \$\endgroup\$
    – Carlos
    Sep 28 '20 at 20:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.