This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Program 9: %Frequency Spectrum of Amplitude Modulated Wave t=0:0.0001:0.02 fc=1000 Ec=7 Carr=Ec*sin(2*pi*fc*t) fm=100 Em=3 Mod=Em*sin(2*pi*fm*t) Am=(Ec+Mod).*(sin(2*pi*fc*t)) FA=fft(Am,1024) subplot(1,1,1) plot(fftshift(abs(FA))) axis([375 700 0 1000]) title('frequency Spectrum of AmplitudeModulated Wave')
`
0719
Output Waveform
`
0720
Program 10: %Frequency Spectrum of Amplitude Modulated Wave t=0:0.0001:0.02 fc=1000 Ec=7 Carr=Ec*sin(2*pi*fc*t) fm=100 Em=3 Mod=Em*sin(2*pi*fm*t) DSBSC=Carr.*Mod FA=fft(DSBSC,1024) subplot(1,1,1) plot(fftshift(abs(FA))) axis([375 700 0 1000]) title('frequency Spectrum of DSBSC Wave')
`
0721
Output Waveform
`
0722
Program 11: %Frequency Spectrum of SSBSC t=0:0.0001:0.04 msg=5*cos(2*pi*200*t) carr=10*cos(2*pi*1000*t) ht=imag(Hilbert(msg)) ssb1=(msg.*(carr/10))+(ht.*sin(2*pi*1000*t)) FT=fft(ssb1) plot(abs(FT)) title(‘Frequency Spectrum of SSBSC wave’)
`
0723
Output Waveforms
`
0724
Program 12: %Performing Pre-emphasis and De-emphasis f1=10; for f=1:50 x(f)=(1/sqrt(1+(f1/f)^2)); f2(f)=f; end subplot(2,1,1); plot(f2,x); title('Pre-emphasis waveform') for f=1:50 y(f)=(1/sqrt(1+(f/f1)^2)); f3(f)=f; end subplot(2,1,2); plot(f3,y); title('De-emphasis waveform')
%Demodulation of FM wave Am=1;Ac=2;fc=500;fm=200;fs=400;kf=30 dt=1/fs T=20e-3 t=0:T/fs:T mod=Am*cos(2*pi*fm*t) FM=Ac*cos(2*pi*fc*t+(2*pi*kf*(cumsum(mod)*dt))) AM=diff(FM) lengthC=400; FM_Diode_out=AM for time_indx=1:lengthC; if(FM_Diode_out(time_indx)<0) FM_Diode_out(time_indx)=0; end end fs1=8000; [den,num]=butter(1,2*pi*fm/fs1); FM_Demod=filter(den,num,FM_Diode_out); for n=1:100 FM_Demod=filter(den,num,FM_Demod) end subplot(3,1,1) plot(t,mod);axis([0 0.01 -5 5]) title('Message Signal') subplot(3,1,2) plot(t,FM);axis([0 0.01 -5 5]) title('FM Signal') subplot(3,1,3) plot(FM_Demod);axis([200 400 0 0.4]) title('FM demodulated signal')
`
0729
Output Waveforms
`
0730
Program 15: %Frequency Spectrum of FM Am=1 Ac=2 fc=500 fm=200 fs=400 kf=30 dt=1/fs T=20e-3 t=0:T/fs:T mod=Am*cos(2*pi*fm*t) FM=Ac*cos(2*pi*fc*t+(2*pi*kf*(cumsum(mod)*dt))) FFM=fft(FM) plot(abs(FFM)) title('Frequency Spectrum')
`
0731
Output Waveforms
`
0732
Program 16: %Construction of SQUELCH circuit t=0:0.0001:0.02 fc=1000;Ec=7 Carr=Ec*sin(2*pi*fc*t) fm=100;Em=5 Mod=Em*sin(2*pi*fm*t) Am=(Ec+Mod).*(sin(2*pi*fc*t)) for t1=1:200 Am1(t1)=Am(t1) end for t1=201:400 Am1(t1)=0 end for t1=401:600 Am1(t1)=Am(t1-400) end disp(' Amplitude Demodulation using diode detector') lengthC=600; AM_Diode_out=Am1 for time_indx=1:lengthC; if(AM_Diode_out(time_indx)<0) AM_Diode_out(time_indx)=0; end end fs=8000; [den,num]=butter(1,2*pi*fm/fs); AM_Demod=filter(den,num,AM_Diode_out); for n=1:10 AM_Demod=filter(den,num,AM_Demod) end subplot(2,1,1);plot(Am1) title('Transmitted Signal') subplot(2,1,2);plot(AM_Demod) title('Squelch Circuit i.e after Quieting')