Help with filtering of DSB modulation.
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Brittany Lisowski
el 18 de Dic. de 2017
Comentada: Star Strider
el 18 de Dic. de 2017
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))
0 comentarios
Respuesta aceptada
Star Strider
el 18 de Dic. de 2017
You need to make two changes to your filter passband design:
t=-0.025:T/10:0.025;
L = length(t);
Fs = 1/mean(diff(t)); % Sampling Frequency
Fn = Fs/2; % Nyquist Frequency
wc1=(fc-4*fm)/Fn;
wc2=(fc-2*fm)/Fn;
I will let you figure out the reason my change here works. It should be close to what you want. Experiment with my code to get the exact result you want.
2 comentarios
Star Strider
el 18 de Dic. de 2017
The lower sideband has been suppressed, and the upper sideband remains. If you look only at the positive frequencies, you will see that the lower sideband is suppressed and a slightly distorted version of the upper sideband remains.
It is difficult to tell from your time-domain plot which sideband is being suppressed. Obviously one is, because if you plot them together, the ‘output’ amplitude is significantly reduced with respect to the ‘y’ amplitude.
I believe you are confusing the symmetry of the two-sided Fourier transform with the sidebands. If you plot the Fourier transform subplot as:
subplot(3,1,3)
plot(f,abs(z))
axis([0 max(xlim) ylim])
so that you see only the positive frequencies, you see that my filter design is working as you want it to.
Más respuestas (0)
Ver también
Categorías
Más información sobre Analog Filters en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!