Geoscience Reference
In-Depth Information
a length of eleven. We therefore have to correct the phase by (11-1)/2=5,
which suggests a zero phase shit for the i lter for both frequencies.
h is also works for recursive i lters. Consider a simple sine wave with a
period of 8 and the previously employed recursive i lter.
clear
t = (1:100)';
x11 = 2*sin(2*pi*t/8);
b11 = [0.0048 0.0193 0.0289 0.0193 0.0048];
a11 = [1.0000 -2.3695 2.3140 -1.0547 0.1874];
m11 = length(b11);
y11 = filter(b11,a11,x11);
We correct the output for the phase shit introduced by causal indexing and
plot both input and output signals.
y11= y11(1+(m11-1)/2:end-(m11-1)/2,1);
y11(end+1:end+m11-1,1) = zeros(m11-1,1);
plot(t,x11,t,y11)
h e magnitude is reduced by
1-max(y11(40:60))/2
ans =
0.6465
which is also supported by the magnitude response
[h,w] = freqz(b11,a11,512);
f = 1*w/(2*pi);
magnitude = abs(h);
plot(f,magnitude)
xlabel('Frequency'), ylabel('Magnitude')
title('Magnitude Response')
1-interp1(f,magnitude,1/8)
ans =
0.6462
h e phase response
phase = 180*angle(h)/pi;
Search WWH ::




Custom Search