Clear Filters
Clear Filters

Problem designing casual filter that eliminates 50hz sine wave

1 view (last 30 days)
Dear friends I have some problem designing this type of filter. The requirements are that I have to design a causal filter that eliminates 50 Hz sine wave signals while the alternating sequence (-1)nu[n] is reinforced with a factor 10.
I assume that the filter should be a BANDSTOP filter so I design it in that way, but when I import it to simulink matlab I am not allowed to connect sine wave input, i get an error which says that I must connect input with discrete sampling time and not continuos sampling time.
I am not sure where is my mistake so help me to solve the problem with the input or tell me how to design filter from the beginning
Thanks in advance All the best!

Accepted Answer

Rick Rosson
Rick Rosson on 17 Jun 2011
The issue here is not with the design of the filter, but rather with how you are trying to use it within Simulink. The filter is a discrete-time or digital filter, whereas the sine wave input block is set-up as a continuous-time or analog signal.
To fix this problem, simply double-click on the sine wave block and change the sampling time from the default value of 0 (meaning continuous-time) to a non-zero number like 1/Fs where Fs represents the sampling rate (in samples per second) of the discrete-time filter.
HTH.

More Answers (1)

siemprepeligroso
siemprepeligroso on 18 Jun 2011
Dear Mr.Rosson
I did manage to solve this problem by replacing the classical sine wave with DSP sine wave block...but now I doubt that my design meet the requirements. "causal filter that eliminates 50 Hz sine wave signals while the alternating sequence (-1)nu[n] is reinforced with a factor 10."
since it says eliminate 50hz sine wave i think that the filter should be BANDSTOP...is it OK (i need confirmation here) while the other part I am not really able to understand :"alternating sequence (-1)nu[n] is reinforced with a factor 10." how can I achieve this???

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!