Design a moving average low-pass filter that has a bandwidth of 20 Hz. Plot the
ID: 1831965 • Letter: D
Question
Design a moving average low-pass filter that has a bandwidth of 20 Hz. Plot the impulse response of this filter as a function of time.
a. How do I do this? Recall that the impulse response of a moving average low-pass filter simply consists of a finite number of unity values. The transfer function then consists of the Fourier transform of this signal (and will look like a sinc function). The bandwidth of this low-pass filter is defined as the frequency at the first zero of this sinc function.
b. Generate an array that is one second long, consisting of the correct number of unity values for a bandwidth of 20 Hz, followed by zeros to complete the array. Note that we are using cycles per second (rather than radians per second) here. Thus, the frequency is simply the inverse of the period.
Matlab commands:
load handel
t = 0:1/Fs:1; % this will make the array 1 second long
n = zeros(t) % a warning occurs here
n(0:1/20) = 1
plot(t,n) % stuck here because an error occurs saying the data may not have more
% than two dimensions
Explanation / Answer
clear all close all clc duration_sec = 1; BW_Hz = 20; load handel.mat % Fs is read when handel.mat is loaded i.e 8192 Ts = 1/Fs ; % period t = [0:Ts:duration_sec]; % this will make the array 1 second long n = zeros(length(t),1); % a warning occurs here n(1:round(Fs/BW_Hz)) = 1; plot(t,n) ;
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.