DSB SC DEMODULATION in matlab
70 次查看(过去 30 天)
显示 更早的评论
I have done DSB SC modulation and demodulation. My problem is that my demodulated signal amplitude is far greater than that of message signal. Can someone help me why this is happening? My code is as follows:
clear all;
clc;
t = 0:0.001:5; %time.
fm = 1;%frequency of message signal.
fc = 10;%frequency of carrier signal.
fs=100*fc;%sampling frequency.
Am = 5;%Amplitude of message signal.
Ac = 5;%Amplitude of carrier signal.
msg =Am.*cos(2*pi*fm*t);%message signal.
carrier = Ac.*cos(2*pi*fc*t);%carrier signal.
%% DSB SC MODULATION AND DEMODULATION.
%===========DSB SC IN TIME DOMAIN==================
dsb_sc = msg.*carrier; %dsb sc modulated wave
%=====DSB SC IN FREQUENCY DOMAIN============
ld=length(dsb_sc);
f=linspace(-fs/2,fs/2,ld);
DSB_SC=fftshift(fft(dsb_sc,ld)/ld); %frequency spectrum of dsb_sc modulated signal.
%=====DSB SC DEMODULATION TIME DOMAIN============
pmo = 2*dsb_sc.*carrier; %product modulator output
pmo = pmo/Ac;
nf = fm/fs; %normalised frequency
[num, den] = butter(5,3*nf); %butter worth lpf of 5th order
msg_r = filter(num,den,pmo); %demodulated signal after passing through lpf
%=====DSB SC DEMODULATION FREQUENCY DOMAIN============
lr=length(msg_r);
fr=linspace(-fs/2,fs/2,lr); %frequency bins
MSG_R=fftshift(fft(msg_r,lr)/lr); %frequency spectrum of demodulated signal
%================ PLOTTING =========================
subplot(4,1,1);
plot(t, msg);
title("MESSAGE SIGNAL (TIME DOMAIN)");
xlabel('time (sec)');
ylabel('amplitude');
grid on;
subplot(4,1,2);
plot(t, carrier);
title("CARRIER SIGNAL (TIME DOMAIN)");
xlabel('time (sec)');
ylabel('amplitude');
grid on;
subplot(4,1,3);
plot(t, dsb_sc);
title("MODULATED DSB SC SIGNAL (TIME DOMAIN)");
xlabel('time (sec)');
ylabel('amplitude');
grid on;
subplot(4,1,4);
plot(t, msg_r);
title("DEMODULATED DSB SC SIGNAL (TIME DOMAIN)");
xlabel('time (sec)');
ylabel('amplitude');
grid on;
figure;
subplot(2,1,1);
plot(f, abs(DSB_SC));
xlim([-15 15]);
title('DSB SC MODULATION IN FREQUENCY DOMAIN');
xlabel('frequency(hz)');
ylabel('amplitude');
grid on;
subplot(2,1,2);
plot(fr, abs(MSG_R));
xlim([-6 6]);
title('DSB SC DE MODULATION IN FREQUENCY DOMAIN');
xlabel('frequency(hz)');
ylabel('amplitude');
grid on;
0 个评论
采纳的回答
Sindhu Karri
2020-11-13
Hi,
Here, message signal amplitude is ‘Am’,carrier signal amplitude is ‘Ac’,
1)Modulated signal is product of message signal and carrier signal ,amplitude of modulated signal is given by Am*Ac.
2)Demodulated signal is product of modulated signal and carrier signal,amplitude of demodulated signal is Am*Ac*Ac.
3)To get this demodulated signal amplitude equal to message signal it needs to be divided by Ac*Ac
Refer to below attached code for better understanding:
t = 0:0.001:5;
fH = 15;
fL = 2;
Ah=5;
Al=10;
xH = Ah*sin(2*pi*fH.*t);
xL = Al*sin(2*pi*fL.*t);
% Modulation
y = xL.*xH;
% De-Modulation By Synchoronous Method
m = (y.*xH)./(Ah*Ah);
% Filtering High Frequencies
[n,w] = buttord(2/1000,4/1000,.5,5);
[a,b] = butter(n,w,'low');
dem = filter(a,b,m);
subplot(2,2,1);
plot(t,xH,'b',t,xL,'r');
title('m(t) & c(t)');
grid;
subplot(2,2,2);
plot(t,y,'k');
title('DSBSC');
grid;
subplot(2,2,3);
plot(t,m);
title('De-Modulated');
grid;
0 个评论
更多回答(5 个)
Abinaya
2023-5-6
t = 0:0.001:5; fH = 15; fL = 2; Ah=5; Al=10; xH = Ah*sin(2*pi*fH.*t); xL = Al*sin(2*pi*fL.*t); % Modulation y = xL.*xH; % De-Modulation By Synchoronous Method m = (y.*xH)./(Ah*Ah); % Filtering High Frequencies [n,w] = buttord(2/1000,4/1000,.5,5); [a,b] = butter(n,w,'low'); dem = filter(a,b,m); subplot(2,2,1); plot(t,xH,'b',t,xL,'r'); title('m(t) & c(t)'); grid; subplot(2,2,2); plot(t,y,'k'); title('DSBSC'); grid; subplot(2,2,3); plot(t,m); title('De-Modulated'); grid;
0 个评论
Abinaya
2023-5-6
t = 0:0.001:5; fH = 15; fL = 2; Ah=5; Al=10; xH = Ah*sin(2*pi*fH.*t); xL = Al*sin(2*pi*fL.*t); % Modulation y = xL.*xH; % De-Modulation By Synchoronous Method m = (y.*xH)./(Ah*Ah); % Filtering High Frequencies [n,w] = buttord(2/1000,4/1000,.5,5); [a,b] = butter(n,w,'low'); dem = filter(a,b,m); subplot(2,2,1); plot(t,xH,'b',t,xL,'r'); title('m(t) & c(t)'); grid; subplot(2,2,2); plot(t,y,'k'); title('DSBSC'); grid; subplot(2,2,3); plot(t,m); title('De-Modulated'); grid;
if true
% code
end
0 个评论
Abinaya
2023-5-6
Clc; Clear all; Close all; t=0: .001:1; fm=5; fc=50; m=(1/2*sin(2*pi*fm*t)); subplot(6,1,1); Plot(m); title('message signal'); C=cos(2*pi*fc*t); Subplot(6,1,2); Plot(c); title('carrier signal'); y=m.*c; Subplot(6,1,3); Plot(y); title('DSB-SC signal'); \demodulation of dsbsc S1=y.*c; [b,a]=butter(5,0.1); S2=filter(b,a,S1); Subplot(6,1,4); Plot(S2); title('demodulation of DSBSC');
0 个评论
Kishore
2024-3-22
clear all;
clc;
t = 0:0.001:5; %time.
fm = 1;%frequency of message signal.
fc = 10;%frequency of carrier signal.
fs=100*fc;%sampling frequency.
Am = 5;%Amplitude of message signal.
Ac = 5;%Amplitude of carrier signal.
msg =Am.*cos(2*pi*fm*t);%message signal.
carrier = Ac.*cos(2*pi*fc*t);%carrier signal.
%% DSB SC MODULATION AND DEMODULATION.
%===========DSB SC IN TIME DOMAIN==================
dsb_sc = msg.*carrier; %dsb sc modulated wave
%=====DSB SC IN FREQUENCY DOMAIN============
ld=length(dsb_sc);
f=linspace(-fs/2,fs/2,ld);
DSB_SC=fftshift(fft(dsb_sc,ld)/ld); %frequency spectrum of dsb_sc modulated signal.
%=====DSB SC DEMODULATION TIME DOMAIN============
pmo = 2*dsb_sc.*carrier; %product modulator output
pmo = pmo/Ac;
nf = fm/fs; %normalised frequency
[num, den] = butter(5,3*nf); %butter worth lpf of 5th order
msg_r = filter(num,den,pmo); %demodulated signal after passing through lpf
%=====DSB SC DEMODULATION FREQUENCY DOMAIN============
lr=length(msg_r);
fr=linspace(-fs/2,fs/2,lr); %frequency bins
MSG_R=fftshift(fft(msg_r,lr)/lr); %frequency spectrum of demodulated signal
%================ PLOTTING =========================
subplot(4,1,1);
plot(t, msg);
title("MESSAGE SIGNAL (TIME DOMAIN)");
xlabel('time (sec)');
ylabel('amplitude');
grid on;
subplot(4,1,2);
plot(t, carrier);
title("CARRIER SIGNAL (TIME DOMAIN)");
xlabel('time (sec)');
ylabel('amplitude');
grid on;
subplot(4,1,3);
plot(t, dsb_sc);
title("MODULATED DSB SC SIGNAL (TIME DOMAIN)");
xlabel('time (sec)');
ylabel('amplitude');
grid on;
subplot(4,1,4);
plot(t, msg_r);
title("DEMODULATED DSB SC SIGNAL (TIME DOMAIN)");
xlabel('time (sec)');
ylabel('amplitude');
grid on;
figure;
subplot(2,1,1);
plot(f, abs(DSB_SC));
xlim([-15 15]);
title('DSB SC MODULATION IN FREQUENCY DOMAIN');
xlabel('frequency(hz)');
ylabel('amplitude');
grid on;
subplot(2,1,2);
plot(fr, abs(MSG_R));
xlim([-6 6]);
title('DSB SC DE MODULATION IN FREQUENCY DOMAIN');
xlabel('frequency(hz)');
ylabel('amplitude');
grid on;
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Modulation 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!