I was using the Moving average filter provided by simulink. I set the window length equal to 31 samples and i was using a fixed step solver with a step size of $\frac{1}{(50\times24)}$. I used a unit amplitude sine signal with a frequency of 50 Hz as the input to this filter (This signal is sampled at the same rate as the solver step size i.e. $1/(50\times 24)$ or $ \sin(\omega_{0} \frac{n}{(50 \times 24)})$. The filter output magnitude was around (approximately) 0.2 p.u. Now, by changing my solver step size to $\frac{1}{(50\times24\times31)}$ (which again is the same as my signal sampling rate i.e $ \sin(\omega_{0} \frac{n}{(50 \times 24 \times 31)})$), where 31 pertains to the filter window length, the resulting filtered signal had the correct amplitude (approximately 0.9971) 1 p.u.

My questions are as follows, 1) why is the amplitude very low in the filter output when i do not incorporate the filter length in the step size of the solver. 2) How do i correct for this amplitude decrease without changing my solver step size i.e. in the first case.

  • 1
    $\begingroup$ Either you have not told us your sampling rate, or simulink is setting your sampling rate according to your fixed solver step. Could you please edit your question to elucidate on this point. $\endgroup$
    – TimWescott
    Dec 29, 2020 at 22:17
  • $\begingroup$ i have edited my question. Go ahead and have a look. $\endgroup$
    – mka_07
    Dec 30, 2020 at 4:59


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.