Geoscience Reference
In-Depth Information
y9 = filter(b9,1,x9);
y9 = y9(1+(m9-1)/2:end-(m9-1)/2,1);
y9(end+1:end+m9-1,1) = zeros(m9-1,1);
h e output y9 is again in phase with the input x9 , but the amplitude is
dramatically reduced compared to that of the input.
plot(t,x9,t,y9)
1-max(y9(40:60))/2
ans =
0.6768
h e running mean over eleven elements reduces the amplitude of this signal
by ~68%. More generally, the i lter response clearly depends on the frequency
of the input. h e frequency components of a more complex signal containing
multiple periodicities are af ected in a dif erent way. h e frequency response
of a i lter
Movie
6.5
clear
b10 = ones(1,11)/11;
can be computed using the function freqz .
[h,w] = freqz(b10,1,512);
h e function freqz returns the complex frequency response h of the digital
i lter b10 . h e frequency axis is normalized to ˀ. We transform the frequency
axis w to the true frequency values f . h e true frequency values f are w times
the sampling frequency (which is one in our example) divided by 2*pi .
f = 1*w/(2*pi);
Next, we calculate and display the magnitude of the frequency response.
magnitude = abs(h);
plot(f,magnitude)
xlabel('Frequency'), ylabel('Magnitude')
title('Magnitude')
h is plot can be used to predict the ef ect of the i lter for any frequency of
an input signal. We can interpolate the magnitude of the frequency response
to calculate the increase or reduction in a signal's amplitude for a specii c
frequency. As an example the interpolation of magnitude for a frequency of
1/20
Search WWH ::




Custom Search