From: ALittleDog on
I apply an analog filter to a stream of time signals. When I look at
its frequency response, the magnitude is always less than 1. But the
results become unstable.I am wondering where the problem could be.
The
code of the characteristics of the filter is attached. The data is a
rand(1000,1) time data.
When I looked at the max(y), it is infinite. I have also applied the
filter to a stream of real data with the sampling frequency = 1000
Hz.
And the result also explodes. I am really confused.
NatFreq = 100;
Damping = 0.7;
Q = 1/(2*Damping);
L = 1;
R = (2*pi*L*NatFreq)/Q;
C = 1/((2*pi*NatFreq)^2 * L);
% 1/LC
% H = -------------------
% s2 + s R/L + 1/LC
% Get response from poles and zeros
K = [1.01];
B = [0 0 K/L/C];
A = [1 R/L 1/L/C];
Freq = logspace(-1,4);
freqs(B, A, 2*pi*Freq)
x = rand(1000,1);
y = filter(B, A, x);
max(x)
max(y)
From: ALittleDog on
Maybe, to implement an analog filter y = filter(B, A, x) is not the
correct command?
Could someone tell me what is the correct command to implement the
analog filter, given the characteristics above, in Matlab?
From: ALittleDog on
On Mar 26, 5:12 pm, ALittleDog <leqia...(a)gmail.com> wrote:
> Maybe, to implement an analog filter y = filter(B, A, x)  is not the
> correct command?
> Could someone tell me what is the correct command to implement the
> analog filter, given the characteristics above, in Matlab?

The problem is found. And the solution is to convert the analog filter
using bilinear function and then apply the filter function.