low pass filter implementation using the simulink's transfer function
low pass filter implementation using the simulink's transfer function
(OP)
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?
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?





RE: low pass filter implementation using the simulink's transfer function
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.
RE: low pass filter implementation using the simulink's transfer function
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.
RE: low pass filter implementation using the simulink's transfer function
2^(1/2)/(2*pi*fcutoff) * s^1 in the denominator.
RE: low pass filter implementation using the simulink's transfer function
Now my question is: can I implement analog style filters in Matlab\Simulink?