Help with filtering of DSB modulation.
Show older comments
I am trying to implement use of a 6th order butterworth bandpass filter for my modulated DSB signal to suppress the lower sideband, and then plot the USSB in both time and frequency domain. My code works for the DSB Modulation, but when I enter the filtering command, it suppresses the upper sideband as opposed to the lower one. Also I have to do this for a 3rd order butterworth as well. In reading the documentation, the bandpass Butterworth command in Matlab account for n as'2n'. I tried to enter 1.5 for n and it failed to work? Is there anyway to do this?
fc=1000; %1000 Hz carrier
T=1/fc;
Ac=10;
fm=100;
Am=1;
t=-0.025:T/10:0.025;
wc1=(fc-2*fm)/10000;
wc2=(fc+2*fm)/10000;
y=(((Ac*Am)/2)*cos((2*pi*fc-2*pi*fm)*t))+(((Ac*Am)/2)*cos((2*pi*fc+2*pi*fm)*t)); %DSB Modulated wave
subplot(3,1,1)
plot(t,y)
title('DSB Modulation')
xlabel('time (s)')
[b,a] = butter(3,[wc1 wc2],'bandpass');
output = filter(b,a,y);
subplot(3,1,2)
plot(t,output)
z = fft(output); %To get the frequency spectrum of the filtered signal
N = length(output);
f = [-N/2:N/2-1]/N;
subplot(3,1,3)
plot(f,abs(z))
Accepted Answer
More Answers (0)
Categories
Find more on Digital Filtering in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!