For a moving average filter defined as: $y(n) = \frac{1}{L} \sum_{l=0}^{L-1} x(n - l)$, write MATLAB to implement it. Plot both input and output signals in time and in frequency. Discuss the results related with filter length L.
Added by Lisa H.
Close
Step 1
Let's say it is a sinusoidal signal with frequency 1 Hz and amplitude 1, sampled at a rate of 100 Hz for 1 second. ```matlab fs = 100; % sampling frequency (Hz) t = 0:1/fs:1-1/fs; % time vector x = sin(2*pi*t); % input signal ``` Show more…
Show all steps
Your feedback will help us improve your experience
Kajal Raghubanshi and 56 other Physics 102 Electricity and Magnetism educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
Compute the output y[n] of the 3-point moving average filter given below. y[n] = sum_{i=0}^{2} frac{1}{3} x[n - i] = frac{1}{3} (x[n] + x[n - 1] + x[n - 2]) The input signal is x[n] = [5 4 3 2 1 1 1] for 0 ≤ n ≤ 6. Plot the input and output signals using MATLAB.
Sri K.
A discrete-time signal X(n) is passed through a digital filter h(n) to produce an output signal y(n). The difference equation of the filter is provided below: y(n) = -0.8y(n-1) + 0.2x(n). (a) Provide an expression for the transfer function H(z). (b) Provide the magnitude of the filter in dB at F = 0 Hz and F = 4000 Hz, and give the -3 dB frequency of the filter in Hz if the intended sampling frequency is 8 kHz. (c) Indicate the nature of the filter (bandpass, notch, low pass, high pass).
Madhur L.
Recommended Textbooks
University Physics with Modern Physics
Physics: Principles with Applications
Fundamentals of Physics
18,000,000+
Students on Numerade
Trusted by students at 8,000+ universities
Watch the video solution with this free unlock.
EMAIL
PASSWORD