Question

x(n)=2cos((pie/4)n)+cos((3*pie/4)n) implement in matlab the filtering problem

x(n)=2cos((pie/4)n)+cos((3*pie/4)n)
implement in matlab the filtering problem
0 0
Add a comment Improve this question Transcribed image text
Answer #1

clear all
clc

%% samples duration
n=0:1:100;
%% Input signal generation
x = 2*cos((pi/4).*n) + cos((3*pi/4).*n);
%% plot the response
figure(1)
stem(n,x)
grid on
xlabel('n')
ylabel('x[n]')
title('Discrete signal response')

%% band pass filter design
order = 6;
f_lc = 0.2; % lower cutoff
f_hc = 0.6; % higher cutoff
%% design the filter
[b,a] = butter(order,f_lc/(f_hc/2));
freqz(b,a)
%% filtering response
y = filter(b,a,x);
%% plot the output response
figure(2)
stem(n,y)
grid on
xlabel('n')
ylabel('y[n]')
title('Filtered response of the output signal')

The original signal response is shown below

The filter response is shown below

The filtered signal response is shown below

Add a comment
Know the answer?
Add Answer to:
x(n)=2cos((pie/4)n)+cos((3*pie/4)n) implement in matlab the filtering problem
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT