Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

low pass filter implementation using the simulink's transfer function

Status
Not open for further replies.

bkirei

Electrical
Nov 30, 2005
3
I'm quite new in Matlab\Simulink so I'm just learning how to use it.
The problem I had find: if I implement a low pass filter (Butterworth aproximation) using the Simulink's transfer function (numerator: [1], denomerator: [1 2^(1/2) 1]), a foreign frequency component apears in the spectrum of the output signal right in the cutoff frequency (in this case 1 rad/sec). I don't understand why.
To be more precise this is the procedure I use to plot the spectrum of the signal:
1. In the Simulink Block, let say I have a signal generator (sine, 10 rad/sec), the output is connected to the transfer function block, and the resulting signal is saved in the Matlab Workspace. (the simulation step is 0.001, simulation time 1)
2. In the Matlab's workspace I make the Fourier transform using the fft funtion
3. The resulting variable of the fft function is plotted by the semilogx function
After following the described procedure, in the spectrum I have two components: one component at x=1, and the second is on x=10.

Did somebody meet the same problem? If yes, what's the solution?
 
Replies continue below

Recommended for you

If you left out those details I then assume that you have uniform time samples at 1 ms for a duration of one second. If you put 1,000 points into an FFT you would have 1 Hz per picket. At the first picket, at x=1 would be DC. If you did not have DC except for the short aperture effect, then you should have a very small DC term, similar in size to the "noise" floor of your FFT. At x=10 there should also only be "noise". You are mixing Hz and radians. To be kind to your audience, it is best to stick with engineering Hz instead of radians when your sample rate is in Hz. You should have seen something around the 62nd picket for the 10 radian/sec input signal, but attenuated by the filter.

Could you clarify the:
1) discrete vs. continuous issue? (it must be consistent throughout).
2) you definition of X, did you mean x=1 radian/sec, or 1 Hz, or the first picket (counting from zero or one?)

Some advice. In the learning stage, choose a privileged length for your FFT that is related to you signal frequency. i.e. pick a signal at 10 Hz and make the FTT time aperture length an integer multiple of 10 ms = 1/10 Hz.
 
I want to thank you the fast replay.
First I'll ansver the second question. All my thinking was made in rad/sec. The reason is simple. When I'm implementing the Butterworth filter I have to write less at the denominator. If I had been using frequnecy the denominator expresion would have been: [1 2*pi*(2)^(1/2) (2*pi)^2]. In this way I will have the cutoff frequncy 1HZ (not Rad/sec). In the signal generator I'm giving the frequncy in rad/sec.

Lets take another exemple: High pass filter impemented by the transfer function.
1. in the simulink block the sine generator has 1 HZ, amplitude 1. The transfer function numerator: [1 0 0], the denominator [1 2^(1/2)/(2*pi*fcutoff) (2*pi*fcutoff)^2]. When I want to move the cutoff frequncy lets say to 100 (HZ), all I have to do is fcutoff=100. Simulatuion parameters: sample time 0.001, simulation time 1.
2. fft of the output.
3. semilogx of the fft result
By doing this I will have a single line in the spectrum, at x=100!!!. This is why I came to the conclusion, something is wrong with the transfer function, or my thinking. (This calculation was made using Hz measurment for the frequency)

Now answering to the first question. Untill know I was using an analog circuit simulator, and the same block didn't give me any "anomalies". It took a some time to me to realize, the matlab is making discrete calculations not continuous, but by choosing properly the simulation parameters it's almoust the same.

 
I think you built an oscillator. The numerator should be (2*pi*fcutoff)^2. You havwe s^2. You just want a constant in the numerator. I am not sure about your
2^(1/2)/(2*pi*fcutoff) * s^1 in the denominator.
 
In continuous domain the transfer function coefficients are OK. The problem is the value of the term 2^(1/2)/(2*pi*fcutoff) is almoust 0. And you are right, because an oscillator has that transfer function. The implemented transfer function (low-pass or high-pass filter) is making it's job just fine, but in the spectrum apears a component at the cutoff frequency.
Now my question is: can I implement analog style filters in Matlab\Simulink?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor