SlideShare a Scribd company logo
1 of 23
1. AM MODULATION AND DEMODULATION
AIM: To simulate am modulation with different modulation index using MATLAB
SOFTWARE

EQUIPMENT REQUIRED:
1. MATLAB SOFTWARE
2. PC

PROGRAM:
fc=50000;
fs=1000000;
f=1000;
m=0.5;
a=1/m;
opt=-a;
t=0:1/fs:((2/f)-(1/fs));
x=cos(2*pi*f*t);
y=modulate(x,fc,fs,'amdsb-tc',opt);
subplot(221);plot(x);grid;title('modulating signal');
subplot(222);plot(y);grid;title('am signal with m=0.5'); % am with m=0.5
m=1.0;opt=-1/m;y=modulate(x,fc,fs,'amdsb-tc',opt);%am with m=1.0
subplot(223);plot(y);grid;title('am with m=1.0');
m=1.2;opt=-1/m;y=modulate(x,fc,fs,'amdsb-tc',opt);%am with m=1.2
subplot(224);plot(y);grid;title('am with m=1.2');
z=demod(y,fc,fs,'amdsb-tc');figure(2);plot(z);
title('demodulated output');grid;
modulating signal                                            am signal with m=0.5
  1                                                         4


0.5                                                         2


  0                                                         0


-0.5                                                        -2


 -1                                                         -4
       0   500         1000          1500     2000               0          500       1000        1500   2000


                  am with m=1.0                                                   am with m=1.2
  2                                                         2


  1                                                         1


  0                                                         0


 -1                                                         -1


 -2                                                         -2
       0   500         1000          1500     2000               0          500       1000        1500   2000




                                              demodulated output
             2




            1.5




             1




            0.5




             0




           -0.5
                  0    200    400       600   800    1000   1200     1400     1600   1800    2000
Result : The AM modulation and demodulation is executed using MATLAB
software.
2. DSBSC MODULATION AND DEMODULATION
AIM: To simulate dsbsc modulation and demodulation using MATLAB SOFTWARE.

EQUIPMENT REQUIRED:
1. MATLAB SOFTWARE
2. PC


PROGRAM:
fc=50000;
fs=1000000;
f=1000;
m=0.5;
a=1/m;
opt=-a;
t=0:1/fs:((2/f)-(1/fs));
x=cos(2*pi*f*t);
s=cos(2*pi*fc*t);%carrier signal
y=modulate(x,fc,fs,'amdsb-sc',opt);
subplot(411);plot(x);grid;title('modulating signal');
subplot(412);plot(s);grid;title('carrier signal');
subplot(413);plot(y);grid;title('DSB-SC signal');
z=demod(y,fc,fs,'amdsb-sc');subplot(414);plot(z);
title('demodulated output');grid;
Result : The DSB-SC modulation and demodulation is executed using MATLAB
software.
modulating signal
1

0

-1
     0   200   400   600   800    1000 1200     1400   1600   1800   2000
                             carrier signal
1

0

-1
     0   200   400   600   800  1000 1200       1400   1600   1800   2000
                            DSB-SC signal
1
0

-1
     0   200   400   600    800  1000 1200      1400   1600   1800   2000
                           demodulated output
1

0
-1
     0   200   400   600   800   1000   1200    1400   1600   1800   2000
3. FM MODULATION AND DEMODULATION
AIM: To simulate FM modulation and demodulation using MATLAB SOFTWARE.

EQUIPMENT REQUIRED:
1. MATLAB SOFTWARE
2. PC


PROGRAM:
%FM generation
close all;
fc=input('Enter the carrier signal freq in hz,fc=');
fm=input('Enter the modulating signal freq in hz,fm =');
m=input('Modulation index,m= ');
t=0:0.0001:0.1;
c=sin(2*pi*fc*t);%carrier signal
M=sin(2*pi*fm*t);% modulating signal
subplot(3,1,1);plot(t,c);
ylabel('amplitude');xlabel('time index');title('Carrier signal');
subplot(3,1,2);plot(t,M);
ylabel('amplitude');xlabel('time index');title('Modulating signal');
y=cos(2*pi*fc*t+(m.*sin(2*pi*fm*t)));
subplot(3,1,3);plot(t,y);
ylabel('amplitude');xlabel('time index');
title('Frequency Modulated signal');
Result : The FM modulation and demodulation is executed using MATLAB software.
Carrier signal
            1
amplitude



            0

            -1
                 0   0.01   0.02   0.03   0.04 0.05 0.06       0.07   0.08   0.09   0.1
                                              time index
                                           Modulating signal
            1
amplitude




            0

            -1
                 0   0.01   0.02   0.03  0.04 0.05 0.06 0.07          0.08   0.09   0.1
                                             time index
                                     Frequency Modulated signal
            1
amplitude




            0

            -1
                 0   0.01   0.02   0.03   0.04 0.05 0.06       0.07   0.08   0.09   0.1
                                              time index
4. SSB MODULATION AND DEMODULATION
AIM: To simulate SSB modulation and demodulation using MATLAB SOFTWARE.

EQUIPMENT REQUIRED:
1. MATLAB SOFTWARE
2. PC


PROGRAM:
plot_frequency = 1000;
t = 0:1/plot_frequency:10;
% Choose a maximum frequency for our signal in Hertz
f_max = 10;
% Use a sinusoidal signal
A = 1;phi = 0;v = cos(2*pi*f_max*t);
% Choose a modulation sensitivity
k_am = 1;
% Choose a carrier frequency in Hertz
f_c = 100;
% Perform SSBSC modulation
u = k_am*v.*cos(2*pi*f_c*t) - k_am*imag(hilbert(v)).*sin(2*pi*f_c*t);
% Choose a noise power
N_0 = 0;
% Add some noise to our signal
u_received = u + sqrt(N_0)*randn(size(u));
% Perform coherent demodulation
u_mixed = u_received.*cos(2*pi*f_c*t);
% Choose a cutoff frequency in Hertz
f_cutoff = f_c/2;
% Low pass filter the signal
v_reconstructed = func_low_pass_filter(t, u_mixed, f_cutoff);
% Plot the results
figure(1)
subplot(2,2,1,'box','on');
holdon
plot(t(1:1000),v(1:1000));
xlabel('t [s]');ylabel('amplitude');title('Message signal');
subplot(2,2,2,'box','on','YLim',[-
ceil(max(abs(u(1:1000)))),ceil(max(abs(u(1:1000))))]);
holdon
plot(t(1:1000),u(1:1000));
xlabel('t [s]');ylabel('amplitude');title('SSBSC signal');
subplot(2,2,3,'box','on','YLim',[-
ceil(max(abs(u(1:1000)))),ceil(max(abs(u(1:1000))))]);
holdon
plot(t(1:1000),u_mixed(1:1000));
xlabel('t [s]');ylabel('amplitude');title('Mixed signal');
subplot(2,2,4,'box','on');
holdon
plot(t(1:1000),v_reconstructed(1:1000));
xlabel('t [s]');ylabel('amplitude');title('Reconstructed message signal');
figure(2)
subplot(2,2,1,'box','on');
pwelch(v,[],[],[],plot_frequency);
title('Message signal');
subplot(2,2,2,'box','on');
pwelch(u,[],[],[],plot_frequency);
title('SSBSC signal');
subplot(2,2,3,'box','on');
pwelch(u_mixed,[],[],[],plot_frequency);title('Mixed signal');
subplot(2,2,4,'box','on');
pwelch(v_reconstructed,[],[],[],plot_frequency);
title('Reconstructed message signal');figure(1)
Result : The SSB-SC modulation and demodulation is executed using MATLAB
software.
Message signal                                        SSBSC signal
                     1                                                  2

                    0.5                                                 1
amplitude




                                                           amplitude
                     0                                                  0

              -0.5                                                      -1

                     -1                                                 -2
                          0        0.5         1                             0            0.5             1
                                  t [s]                                                  t [s]
                               Mixed signal                                  Reconstructed message signal
                     2                                                 0.5

                     1
        amplitude




                                                   amplitude




                     0                                                  0

                     -1

                     -2                                          -0.5
                          0         0.5        1                             0            0.5            1
                                   t [s]                                                 t [s]
Message signal                                             SSBSC signal
                            0                                                         0
Power/frequency (dB/Hz)




                                                          Power/frequency (dB/Hz)
                           -50                                                       -50




                          -100                                                      -100
                                 0   0.1 0.2 0.3 0.4                                       0   0.1 0.2 0.3 0.4
                                        Frequency (kHz)                                           Frequency (kHz)
                                          Mixed signal                                     Reconstructed message signal
                            0                                                         0
Power/frequency (dB/Hz)




                                                          Power/frequency (dB/Hz)


                           -50                                                       -50




                          -100                                                      -100
                                 0   0.1 0.2 0.3 0.4                                       0   0.1 0.2 0.3 0.4
                                        Frequency (kHz)                                           Frequency (kHz)
5. PWM MODULATION AND DEMODULATION
AIM: To simulate PWM modulation and Demodulation using MATLAB SOFTWARE.

EQUIPMENT REQUIRED:
1. MATLAB SOFTWARE
2. PC


PROGRAM:
%PWM wave generation
t=0:0.001:1;
s=sawtooth(2*pi*10*t+pi);
m=0.75*sin(2*pi*1*t);
n=length(s);
for i=1:n
if (m(i)>=s(i))
pwm(i)=1;
elseif (m(i)<=s(i))
pwm(i)=0;
end
end
plot(t,pwm,'-r',t,m,'--k',t,s,'--b');grid;
title('PWM wave');axis([0 1 -1.5 1.5]);
Result : The PWM modulation and demodulation is executed using MATLAB software.
PWM wave
1.5



  1



0.5



  0



-0.5



 -1



-1.5
       0   0.1   0.2   0.3   0.4      0.5     0.6   0.7   0.8   0.9   1
6. ANALOG SIGNAL SAMPLING AND RECONSTRUCTION
AIM: To simulate analog signal sampling and reconstruction using MATLAB
SOFTWARE.

EQUIPMENT REQUIRED:
1. MATLAB SOFTWARE
2. PC


PROGRAM:
%creating "analog" signal
clear; %clears all variables
t=0:.1:20;F1=.1;F2=.2;
x=sin(2*pi*F1*t)+sin(2*pi*F2*t);
%plotting
figure(1);subplot(2,1,1);plot(t,x);
title('Original signal')
xlabel('t');ylabel('x(t)');subplot(2,1,2);
x_samples=x(1:10:201); %gets 21 samples of x.
stem(x_samples,'filled');
title('Sampled signal');xlabel('n');ylabel('x_s(n)');
axis([0 20 -2 2]);
%starting reconstruction process
figure(2);
subplot(2,1,2);plot(t,x,'black');
holdon;
plot([0 20],[0 0],'black');
holdoff;
xlabel('t');ylabel('x(t)');title('Original signal');
grid;
x_recon=0;subplot(2,1,1);
for k=0:length(x_samples)-1
stem(0:length(x_samples)-1,x_samples,'filled');
if k==length(x_samples)-1
title('Reconstruction finished');
else
title('Sample by sample reconstruction');
end
gridon;
     l=k:-.1:-20+k;
x_recon=x_recon+x_samples(k+1)*sinc(l);
axis([0 20 -2 2]);
hold;
plot(t,x_samples(k+1)*sinc(l),'r')
plot(t,x_recon);
holdoff;
waitforbuttonpress;
end
Result : The Analog signal sampling and reconstruction is executed using MATLAB software.
Original signal
       2

       1
x(t)




       0

       -1

       -2
            0   2   4    6      8    10      12     14      16   18   20
                                      t
                        Sample by sample reconstruction
       2

       1

       0

       -1

       -2
            0   2   4    6      8      10      12      14   16   18   20




                             Reconstruction finished
       2

       1

       0

       -1

       -2
            0   2   4    6      8      10      12      14   16   18   20

                                 Original signal
       2

       1
x(t)




       0

       -1

       -2
            0   2   4    6      8      10      12      14   16   18   20
                                        t
7. PPM MODULATION AND DEMODULATION
AIM: To simulate PPM modulation and demodulation using MATLAB SOFTWARE.

EQUIPMENT REQUIRED:
1. MATLAB SOFTWARE
2. PC


PROGRAM:
fc=50;
fs=1000;
f1=200;f2=300;
t=0:1/fs:((2/f1)-(1/fs));
x1=0.4*cos(2*pi*f1*t)+0.5;
subplot(311);plot(x1);title('message signal');GRID;
subplot(312);y=modulate(x1,fc,fs,'ppm');plot(y);
title('PPM MODULATION');
GRID;
z=demod(y,fc,fs,'ppm');
subplot(313);plot(z);title('demodulated o/p');grid;
Result : The Pulse Position modulation and demodulation is executed using MATLAB
software.
message signal
 1


0.5


 0
      1    2    3        4         5         6         7     8     9     10
                             PPM MODULATION
 1


0.5


 0
      0   20   40   60        80       100       120   140   160   180   200
                              demodulated o/p
 1


0.5


 0
      1    2    3        4         5         6         7     8     9     10

More Related Content

What's hot

Quadrature amplitude modulation qam transmitter
Quadrature amplitude modulation qam transmitterQuadrature amplitude modulation qam transmitter
Quadrature amplitude modulation qam transmitterAsaad Drake
 
Lecture psk qam, digital modulation
Lecture psk qam, digital modulation Lecture psk qam, digital modulation
Lecture psk qam, digital modulation DrAimalKhan
 
Relationships Among EVM, BER and SNR + WiFi minimum SNR consideration
Relationships Among EVM, BER and SNR + WiFi minimum SNR considerationRelationships Among EVM, BER and SNR + WiFi minimum SNR consideration
Relationships Among EVM, BER and SNR + WiFi minimum SNR considerationPei-Che Chang
 
M ary psk and m ary qam ppt
M ary psk and m ary qam pptM ary psk and m ary qam ppt
M ary psk and m ary qam pptDANISHAMIN950
 
Correlative level coding
Correlative level codingCorrelative level coding
Correlative level codingsrkrishna341
 
Digital modulation techniques
Digital modulation techniquesDigital modulation techniques
Digital modulation techniquesmpsrekha83
 
Angle modulation
Angle modulationAngle modulation
Angle modulationJay Shah
 
Amplitute modulation
Amplitute modulationAmplitute modulation
Amplitute modulationZunAib Ali
 
DSP_2018_FOEHU - Lec 06 - FIR Filter Design
DSP_2018_FOEHU - Lec 06 - FIR Filter DesignDSP_2018_FOEHU - Lec 06 - FIR Filter Design
DSP_2018_FOEHU - Lec 06 - FIR Filter DesignAmr E. Mohamed
 
Frequency modulation
Frequency modulationFrequency modulation
Frequency modulationAkanksha_Seth
 
Ee443 phase locked loop - presentation - schwappach and brandy
Ee443   phase locked loop - presentation - schwappach and brandyEe443   phase locked loop - presentation - schwappach and brandy
Ee443 phase locked loop - presentation - schwappach and brandyLoren Schwappach
 
RF Module Design - [Chapter 6] Power Amplifier
RF Module Design - [Chapter 6]  Power AmplifierRF Module Design - [Chapter 6]  Power Amplifier
RF Module Design - [Chapter 6] Power AmplifierSimen Li
 
Amplitude shift keying (ask)
Amplitude shift keying (ask)Amplitude shift keying (ask)
Amplitude shift keying (ask)MOHAN MOHAN
 
Delta modulation
Delta modulationDelta modulation
Delta modulationHanu Kavi
 

What's hot (20)

Quadrature amplitude modulation qam transmitter
Quadrature amplitude modulation qam transmitterQuadrature amplitude modulation qam transmitter
Quadrature amplitude modulation qam transmitter
 
Lecture psk qam, digital modulation
Lecture psk qam, digital modulation Lecture psk qam, digital modulation
Lecture psk qam, digital modulation
 
Relationships Among EVM, BER and SNR + WiFi minimum SNR consideration
Relationships Among EVM, BER and SNR + WiFi minimum SNR considerationRelationships Among EVM, BER and SNR + WiFi minimum SNR consideration
Relationships Among EVM, BER and SNR + WiFi minimum SNR consideration
 
M ary psk and m ary qam ppt
M ary psk and m ary qam pptM ary psk and m ary qam ppt
M ary psk and m ary qam ppt
 
Correlative level coding
Correlative level codingCorrelative level coding
Correlative level coding
 
PA linearity
PA linearityPA linearity
PA linearity
 
Digital modulation techniques
Digital modulation techniquesDigital modulation techniques
Digital modulation techniques
 
Single sidebands ssb lathi
Single sidebands ssb   lathiSingle sidebands ssb   lathi
Single sidebands ssb lathi
 
Angle modulation
Angle modulationAngle modulation
Angle modulation
 
Amplitute modulation
Amplitute modulationAmplitute modulation
Amplitute modulation
 
DSP_2018_FOEHU - Lec 06 - FIR Filter Design
DSP_2018_FOEHU - Lec 06 - FIR Filter DesignDSP_2018_FOEHU - Lec 06 - FIR Filter Design
DSP_2018_FOEHU - Lec 06 - FIR Filter Design
 
Amplitude modulation
Amplitude modulationAmplitude modulation
Amplitude modulation
 
Frequency modulation
Frequency modulationFrequency modulation
Frequency modulation
 
Ee443 phase locked loop - presentation - schwappach and brandy
Ee443   phase locked loop - presentation - schwappach and brandyEe443   phase locked loop - presentation - schwappach and brandy
Ee443 phase locked loop - presentation - schwappach and brandy
 
Modulacion pcm
Modulacion pcmModulacion pcm
Modulacion pcm
 
RF Module Design - [Chapter 6] Power Amplifier
RF Module Design - [Chapter 6]  Power AmplifierRF Module Design - [Chapter 6]  Power Amplifier
RF Module Design - [Chapter 6] Power Amplifier
 
Amplitude shift keying (ask)
Amplitude shift keying (ask)Amplitude shift keying (ask)
Amplitude shift keying (ask)
 
Dc unit iii final ppt
Dc unit iii final pptDc unit iii final ppt
Dc unit iii final ppt
 
Matched filter
Matched filterMatched filter
Matched filter
 
Delta modulation
Delta modulationDelta modulation
Delta modulation
 

Similar to Ac matlab programs

Modulation by sanjay
Modulation by sanjay Modulation by sanjay
Modulation by sanjay Sanjay Songra
 
Signal Processing Course : Wavelets
Signal Processing Course : WaveletsSignal Processing Course : Wavelets
Signal Processing Course : WaveletsGabriel Peyré
 
Wavelet transform and its applications in data analysis and signal and image ...
Wavelet transform and its applications in data analysis and signal and image ...Wavelet transform and its applications in data analysis and signal and image ...
Wavelet transform and its applications in data analysis and signal and image ...Sourjya Dutta
 
Cosine modulated filter bank transmultiplexer using kaiser window
Cosine modulated filter bank transmultiplexer using kaiser windowCosine modulated filter bank transmultiplexer using kaiser window
Cosine modulated filter bank transmultiplexer using kaiser windowIAEME Publication
 
Text Prompted Remote Speaker Authentication : Joint Speech and Speaker Recogn...
Text Prompted Remote Speaker Authentication : Joint Speech and Speaker Recogn...Text Prompted Remote Speaker Authentication : Joint Speech and Speaker Recogn...
Text Prompted Remote Speaker Authentication : Joint Speech and Speaker Recogn...gt_ebuddy
 
SPICE MODEL of S60SC4MT (Professional Model) in SPICE PARK
SPICE MODEL of S60SC4MT (Professional Model) in SPICE PARKSPICE MODEL of S60SC4MT (Professional Model) in SPICE PARK
SPICE MODEL of S60SC4MT (Professional Model) in SPICE PARKTsuyoshi Horigome
 
チョークコイルのスパイスモデルの事例
チョークコイルのスパイスモデルの事例チョークコイルのスパイスモデルの事例
チョークコイルのスパイスモデルの事例Tsuyoshi Horigome
 
NumXL 1.55 LYNX release notes
NumXL 1.55 LYNX release notesNumXL 1.55 LYNX release notes
NumXL 1.55 LYNX release notesSpider Financial
 
Amplitude, Frequency, Pulse code modulation and Demodulation (com. lab)
Amplitude, Frequency, Pulse code modulation and Demodulation (com. lab)Amplitude, Frequency, Pulse code modulation and Demodulation (com. lab)
Amplitude, Frequency, Pulse code modulation and Demodulation (com. lab)Shahrin Ahammad
 
SPICE MODEL of XBS024S15R-G (Professional Model) in SPICE PARK
SPICE MODEL of XBS024S15R-G (Professional Model) in SPICE PARKSPICE MODEL of XBS024S15R-G (Professional Model) in SPICE PARK
SPICE MODEL of XBS024S15R-G (Professional Model) in SPICE PARKTsuyoshi Horigome
 
Short-time homomorphic wavelet estimation
Short-time homomorphic wavelet estimation Short-time homomorphic wavelet estimation
Short-time homomorphic wavelet estimation UT Technology
 
Modeling of lifetimes of forest fires
Modeling of lifetimes of forest firesModeling of lifetimes of forest fires
Modeling of lifetimes of forest firesBhaswat Chakraborty
 
SPICE MODEL of S30SC4MT (Professional Model) in SPICE PARK
SPICE MODEL of S30SC4MT (Professional Model) in SPICE PARKSPICE MODEL of S30SC4MT (Professional Model) in SPICE PARK
SPICE MODEL of S30SC4MT (Professional Model) in SPICE PARKTsuyoshi Horigome
 
SPICE MODEL of S30SC4MT (Professional Model) in SPICE PARK
SPICE MODEL of S30SC4MT (Professional Model) in SPICE PARKSPICE MODEL of S30SC4MT (Professional Model) in SPICE PARK
SPICE MODEL of S30SC4MT (Professional Model) in SPICE PARKTsuyoshi Horigome
 
SPICE MODEL of SG30SC6M (Standard Model) in SPICE PARK
SPICE MODEL of SG30SC6M (Standard Model) in SPICE PARKSPICE MODEL of SG30SC6M (Standard Model) in SPICE PARK
SPICE MODEL of SG30SC6M (Standard Model) in SPICE PARKTsuyoshi Horigome
 
SPICE MODEL of SG30SC6M (Standard Model) in SPICE PARK
SPICE MODEL of SG30SC6M (Standard Model) in SPICE PARKSPICE MODEL of SG30SC6M (Standard Model) in SPICE PARK
SPICE MODEL of SG30SC6M (Standard Model) in SPICE PARKTsuyoshi Horigome
 

Similar to Ac matlab programs (20)

Compressive sensing for transient analsyis
Compressive sensing for transient analsyisCompressive sensing for transient analsyis
Compressive sensing for transient analsyis
 
Modulation by sanjay
Modulation by sanjay Modulation by sanjay
Modulation by sanjay
 
www.ijerd.com
www.ijerd.comwww.ijerd.com
www.ijerd.com
 
Signal Processing Course : Wavelets
Signal Processing Course : WaveletsSignal Processing Course : Wavelets
Signal Processing Course : Wavelets
 
Wavelet transform and its applications in data analysis and signal and image ...
Wavelet transform and its applications in data analysis and signal and image ...Wavelet transform and its applications in data analysis and signal and image ...
Wavelet transform and its applications in data analysis and signal and image ...
 
Cosine modulated filter bank transmultiplexer using kaiser window
Cosine modulated filter bank transmultiplexer using kaiser windowCosine modulated filter bank transmultiplexer using kaiser window
Cosine modulated filter bank transmultiplexer using kaiser window
 
oscillators
oscillatorsoscillators
oscillators
 
Text Prompted Remote Speaker Authentication : Joint Speech and Speaker Recogn...
Text Prompted Remote Speaker Authentication : Joint Speech and Speaker Recogn...Text Prompted Remote Speaker Authentication : Joint Speech and Speaker Recogn...
Text Prompted Remote Speaker Authentication : Joint Speech and Speaker Recogn...
 
SPICE MODEL of S60SC4MT (Professional Model) in SPICE PARK
SPICE MODEL of S60SC4MT (Professional Model) in SPICE PARKSPICE MODEL of S60SC4MT (Professional Model) in SPICE PARK
SPICE MODEL of S60SC4MT (Professional Model) in SPICE PARK
 
チョークコイルのスパイスモデルの事例
チョークコイルのスパイスモデルの事例チョークコイルのスパイスモデルの事例
チョークコイルのスパイスモデルの事例
 
NumXL 1.55 LYNX release notes
NumXL 1.55 LYNX release notesNumXL 1.55 LYNX release notes
NumXL 1.55 LYNX release notes
 
Amplitude, Frequency, Pulse code modulation and Demodulation (com. lab)
Amplitude, Frequency, Pulse code modulation and Demodulation (com. lab)Amplitude, Frequency, Pulse code modulation and Demodulation (com. lab)
Amplitude, Frequency, Pulse code modulation and Demodulation (com. lab)
 
Project gr4 sec_d
Project gr4 sec_dProject gr4 sec_d
Project gr4 sec_d
 
SPICE MODEL of XBS024S15R-G (Professional Model) in SPICE PARK
SPICE MODEL of XBS024S15R-G (Professional Model) in SPICE PARKSPICE MODEL of XBS024S15R-G (Professional Model) in SPICE PARK
SPICE MODEL of XBS024S15R-G (Professional Model) in SPICE PARK
 
Short-time homomorphic wavelet estimation
Short-time homomorphic wavelet estimation Short-time homomorphic wavelet estimation
Short-time homomorphic wavelet estimation
 
Modeling of lifetimes of forest fires
Modeling of lifetimes of forest firesModeling of lifetimes of forest fires
Modeling of lifetimes of forest fires
 
SPICE MODEL of S30SC4MT (Professional Model) in SPICE PARK
SPICE MODEL of S30SC4MT (Professional Model) in SPICE PARKSPICE MODEL of S30SC4MT (Professional Model) in SPICE PARK
SPICE MODEL of S30SC4MT (Professional Model) in SPICE PARK
 
SPICE MODEL of S30SC4MT (Professional Model) in SPICE PARK
SPICE MODEL of S30SC4MT (Professional Model) in SPICE PARKSPICE MODEL of S30SC4MT (Professional Model) in SPICE PARK
SPICE MODEL of S30SC4MT (Professional Model) in SPICE PARK
 
SPICE MODEL of SG30SC6M (Standard Model) in SPICE PARK
SPICE MODEL of SG30SC6M (Standard Model) in SPICE PARKSPICE MODEL of SG30SC6M (Standard Model) in SPICE PARK
SPICE MODEL of SG30SC6M (Standard Model) in SPICE PARK
 
SPICE MODEL of SG30SC6M (Standard Model) in SPICE PARK
SPICE MODEL of SG30SC6M (Standard Model) in SPICE PARKSPICE MODEL of SG30SC6M (Standard Model) in SPICE PARK
SPICE MODEL of SG30SC6M (Standard Model) in SPICE PARK
 

Recently uploaded

Mbaye_Astou.Education Civica_Human Rights.pptx
Mbaye_Astou.Education Civica_Human Rights.pptxMbaye_Astou.Education Civica_Human Rights.pptx
Mbaye_Astou.Education Civica_Human Rights.pptxnuriaiuzzolino1
 
IATP How-to Foreign Travel May 2024.pdff
IATP How-to Foreign Travel May 2024.pdffIATP How-to Foreign Travel May 2024.pdff
IATP How-to Foreign Travel May 2024.pdff17thcssbs2
 
philosophy and it's principles based on the life
philosophy and it's principles based on the lifephilosophy and it's principles based on the life
philosophy and it's principles based on the lifeNitinDeodare
 
The Benefits and Challenges of Open Educational Resources
The Benefits and Challenges of Open Educational ResourcesThe Benefits and Challenges of Open Educational Resources
The Benefits and Challenges of Open Educational Resourcesaileywriter
 
factors influencing drug absorption-final-2.pptx
factors influencing drug absorption-final-2.pptxfactors influencing drug absorption-final-2.pptx
factors influencing drug absorption-final-2.pptxSanjay Shekar
 
Pragya Champions Chalice 2024 Prelims & Finals Q/A set, General Quiz
Pragya Champions Chalice 2024 Prelims & Finals Q/A set, General QuizPragya Champions Chalice 2024 Prelims & Finals Q/A set, General Quiz
Pragya Champions Chalice 2024 Prelims & Finals Q/A set, General QuizPragya - UEM Kolkata Quiz Club
 
Basic_QTL_Marker-assisted_Selection_Sourabh.ppt
Basic_QTL_Marker-assisted_Selection_Sourabh.pptBasic_QTL_Marker-assisted_Selection_Sourabh.ppt
Basic_QTL_Marker-assisted_Selection_Sourabh.pptSourabh Kumar
 
[GDSC YCCE] Build with AI Online Presentation
[GDSC YCCE] Build with AI Online Presentation[GDSC YCCE] Build with AI Online Presentation
[GDSC YCCE] Build with AI Online PresentationGDSCYCCE
 
Basic Civil Engg Notes_Chapter-6_Environment Pollution & Engineering
Basic Civil Engg Notes_Chapter-6_Environment Pollution & EngineeringBasic Civil Engg Notes_Chapter-6_Environment Pollution & Engineering
Basic Civil Engg Notes_Chapter-6_Environment Pollution & EngineeringDenish Jangid
 
Keeping Your Information Safe with Centralized Security Services
Keeping Your Information Safe with Centralized Security ServicesKeeping Your Information Safe with Centralized Security Services
Keeping Your Information Safe with Centralized Security ServicesTechSoup
 
2024_Student Session 2_ Set Plan Preparation.pptx
2024_Student Session 2_ Set Plan Preparation.pptx2024_Student Session 2_ Set Plan Preparation.pptx
2024_Student Session 2_ Set Plan Preparation.pptxmansk2
 
Open Educational Resources Primer PowerPoint
Open Educational Resources Primer PowerPointOpen Educational Resources Primer PowerPoint
Open Educational Resources Primer PowerPointELaRue0
 
....................Muslim-Law notes.pdf
....................Muslim-Law notes.pdf....................Muslim-Law notes.pdf
....................Muslim-Law notes.pdfVikramadityaRaj
 
How to the fix Attribute Error in odoo 17
How to the fix Attribute Error in odoo 17How to the fix Attribute Error in odoo 17
How to the fix Attribute Error in odoo 17Celine George
 
Incoming and Outgoing Shipments in 2 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 2 STEPS Using Odoo 17Incoming and Outgoing Shipments in 2 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 2 STEPS Using Odoo 17Celine George
 
The basics of sentences session 4pptx.pptx
The basics of sentences session 4pptx.pptxThe basics of sentences session 4pptx.pptx
The basics of sentences session 4pptx.pptxheathfieldcps1
 
slides CapTechTalks Webinar May 2024 Alexander Perry.pptx
slides CapTechTalks Webinar May 2024 Alexander Perry.pptxslides CapTechTalks Webinar May 2024 Alexander Perry.pptx
slides CapTechTalks Webinar May 2024 Alexander Perry.pptxCapitolTechU
 
Liberal & Redical Feminism presentation.pptx
Liberal & Redical Feminism presentation.pptxLiberal & Redical Feminism presentation.pptx
Liberal & Redical Feminism presentation.pptxRizwan Abbas
 

Recently uploaded (20)

Mbaye_Astou.Education Civica_Human Rights.pptx
Mbaye_Astou.Education Civica_Human Rights.pptxMbaye_Astou.Education Civica_Human Rights.pptx
Mbaye_Astou.Education Civica_Human Rights.pptx
 
“O BEIJO” EM ARTE .
“O BEIJO” EM ARTE                       .“O BEIJO” EM ARTE                       .
“O BEIJO” EM ARTE .
 
IATP How-to Foreign Travel May 2024.pdff
IATP How-to Foreign Travel May 2024.pdffIATP How-to Foreign Travel May 2024.pdff
IATP How-to Foreign Travel May 2024.pdff
 
philosophy and it's principles based on the life
philosophy and it's principles based on the lifephilosophy and it's principles based on the life
philosophy and it's principles based on the life
 
The Benefits and Challenges of Open Educational Resources
The Benefits and Challenges of Open Educational ResourcesThe Benefits and Challenges of Open Educational Resources
The Benefits and Challenges of Open Educational Resources
 
factors influencing drug absorption-final-2.pptx
factors influencing drug absorption-final-2.pptxfactors influencing drug absorption-final-2.pptx
factors influencing drug absorption-final-2.pptx
 
Pragya Champions Chalice 2024 Prelims & Finals Q/A set, General Quiz
Pragya Champions Chalice 2024 Prelims & Finals Q/A set, General QuizPragya Champions Chalice 2024 Prelims & Finals Q/A set, General Quiz
Pragya Champions Chalice 2024 Prelims & Finals Q/A set, General Quiz
 
Basic_QTL_Marker-assisted_Selection_Sourabh.ppt
Basic_QTL_Marker-assisted_Selection_Sourabh.pptBasic_QTL_Marker-assisted_Selection_Sourabh.ppt
Basic_QTL_Marker-assisted_Selection_Sourabh.ppt
 
[GDSC YCCE] Build with AI Online Presentation
[GDSC YCCE] Build with AI Online Presentation[GDSC YCCE] Build with AI Online Presentation
[GDSC YCCE] Build with AI Online Presentation
 
Basic Civil Engg Notes_Chapter-6_Environment Pollution & Engineering
Basic Civil Engg Notes_Chapter-6_Environment Pollution & EngineeringBasic Civil Engg Notes_Chapter-6_Environment Pollution & Engineering
Basic Civil Engg Notes_Chapter-6_Environment Pollution & Engineering
 
Keeping Your Information Safe with Centralized Security Services
Keeping Your Information Safe with Centralized Security ServicesKeeping Your Information Safe with Centralized Security Services
Keeping Your Information Safe with Centralized Security Services
 
2024_Student Session 2_ Set Plan Preparation.pptx
2024_Student Session 2_ Set Plan Preparation.pptx2024_Student Session 2_ Set Plan Preparation.pptx
2024_Student Session 2_ Set Plan Preparation.pptx
 
Open Educational Resources Primer PowerPoint
Open Educational Resources Primer PowerPointOpen Educational Resources Primer PowerPoint
Open Educational Resources Primer PowerPoint
 
....................Muslim-Law notes.pdf
....................Muslim-Law notes.pdf....................Muslim-Law notes.pdf
....................Muslim-Law notes.pdf
 
How to the fix Attribute Error in odoo 17
How to the fix Attribute Error in odoo 17How to the fix Attribute Error in odoo 17
How to the fix Attribute Error in odoo 17
 
Incoming and Outgoing Shipments in 2 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 2 STEPS Using Odoo 17Incoming and Outgoing Shipments in 2 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 2 STEPS Using Odoo 17
 
The basics of sentences session 4pptx.pptx
The basics of sentences session 4pptx.pptxThe basics of sentences session 4pptx.pptx
The basics of sentences session 4pptx.pptx
 
slides CapTechTalks Webinar May 2024 Alexander Perry.pptx
slides CapTechTalks Webinar May 2024 Alexander Perry.pptxslides CapTechTalks Webinar May 2024 Alexander Perry.pptx
slides CapTechTalks Webinar May 2024 Alexander Perry.pptx
 
B.ed spl. HI pdusu exam paper-2023-24.pdf
B.ed spl. HI pdusu exam paper-2023-24.pdfB.ed spl. HI pdusu exam paper-2023-24.pdf
B.ed spl. HI pdusu exam paper-2023-24.pdf
 
Liberal & Redical Feminism presentation.pptx
Liberal & Redical Feminism presentation.pptxLiberal & Redical Feminism presentation.pptx
Liberal & Redical Feminism presentation.pptx
 

Ac matlab programs

  • 1. 1. AM MODULATION AND DEMODULATION AIM: To simulate am modulation with different modulation index using MATLAB SOFTWARE EQUIPMENT REQUIRED: 1. MATLAB SOFTWARE 2. PC PROGRAM: fc=50000; fs=1000000; f=1000; m=0.5; a=1/m; opt=-a; t=0:1/fs:((2/f)-(1/fs)); x=cos(2*pi*f*t); y=modulate(x,fc,fs,'amdsb-tc',opt); subplot(221);plot(x);grid;title('modulating signal'); subplot(222);plot(y);grid;title('am signal with m=0.5'); % am with m=0.5 m=1.0;opt=-1/m;y=modulate(x,fc,fs,'amdsb-tc',opt);%am with m=1.0 subplot(223);plot(y);grid;title('am with m=1.0'); m=1.2;opt=-1/m;y=modulate(x,fc,fs,'amdsb-tc',opt);%am with m=1.2 subplot(224);plot(y);grid;title('am with m=1.2'); z=demod(y,fc,fs,'amdsb-tc');figure(2);plot(z); title('demodulated output');grid;
  • 2. modulating signal am signal with m=0.5 1 4 0.5 2 0 0 -0.5 -2 -1 -4 0 500 1000 1500 2000 0 500 1000 1500 2000 am with m=1.0 am with m=1.2 2 2 1 1 0 0 -1 -1 -2 -2 0 500 1000 1500 2000 0 500 1000 1500 2000 demodulated output 2 1.5 1 0.5 0 -0.5 0 200 400 600 800 1000 1200 1400 1600 1800 2000
  • 3. Result : The AM modulation and demodulation is executed using MATLAB software.
  • 4. 2. DSBSC MODULATION AND DEMODULATION AIM: To simulate dsbsc modulation and demodulation using MATLAB SOFTWARE. EQUIPMENT REQUIRED: 1. MATLAB SOFTWARE 2. PC PROGRAM: fc=50000; fs=1000000; f=1000; m=0.5; a=1/m; opt=-a; t=0:1/fs:((2/f)-(1/fs)); x=cos(2*pi*f*t); s=cos(2*pi*fc*t);%carrier signal y=modulate(x,fc,fs,'amdsb-sc',opt); subplot(411);plot(x);grid;title('modulating signal'); subplot(412);plot(s);grid;title('carrier signal'); subplot(413);plot(y);grid;title('DSB-SC signal'); z=demod(y,fc,fs,'amdsb-sc');subplot(414);plot(z); title('demodulated output');grid;
  • 5. Result : The DSB-SC modulation and demodulation is executed using MATLAB software.
  • 6. modulating signal 1 0 -1 0 200 400 600 800 1000 1200 1400 1600 1800 2000 carrier signal 1 0 -1 0 200 400 600 800 1000 1200 1400 1600 1800 2000 DSB-SC signal 1 0 -1 0 200 400 600 800 1000 1200 1400 1600 1800 2000 demodulated output 1 0 -1 0 200 400 600 800 1000 1200 1400 1600 1800 2000
  • 7. 3. FM MODULATION AND DEMODULATION AIM: To simulate FM modulation and demodulation using MATLAB SOFTWARE. EQUIPMENT REQUIRED: 1. MATLAB SOFTWARE 2. PC PROGRAM: %FM generation close all; fc=input('Enter the carrier signal freq in hz,fc='); fm=input('Enter the modulating signal freq in hz,fm ='); m=input('Modulation index,m= '); t=0:0.0001:0.1; c=sin(2*pi*fc*t);%carrier signal M=sin(2*pi*fm*t);% modulating signal subplot(3,1,1);plot(t,c); ylabel('amplitude');xlabel('time index');title('Carrier signal'); subplot(3,1,2);plot(t,M); ylabel('amplitude');xlabel('time index');title('Modulating signal'); y=cos(2*pi*fc*t+(m.*sin(2*pi*fm*t))); subplot(3,1,3);plot(t,y); ylabel('amplitude');xlabel('time index'); title('Frequency Modulated signal');
  • 8. Result : The FM modulation and demodulation is executed using MATLAB software.
  • 9. Carrier signal 1 amplitude 0 -1 0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 time index Modulating signal 1 amplitude 0 -1 0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 time index Frequency Modulated signal 1 amplitude 0 -1 0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 time index
  • 10. 4. SSB MODULATION AND DEMODULATION AIM: To simulate SSB modulation and demodulation using MATLAB SOFTWARE. EQUIPMENT REQUIRED: 1. MATLAB SOFTWARE 2. PC PROGRAM: plot_frequency = 1000; t = 0:1/plot_frequency:10; % Choose a maximum frequency for our signal in Hertz f_max = 10; % Use a sinusoidal signal A = 1;phi = 0;v = cos(2*pi*f_max*t); % Choose a modulation sensitivity k_am = 1; % Choose a carrier frequency in Hertz f_c = 100; % Perform SSBSC modulation u = k_am*v.*cos(2*pi*f_c*t) - k_am*imag(hilbert(v)).*sin(2*pi*f_c*t); % Choose a noise power N_0 = 0; % Add some noise to our signal u_received = u + sqrt(N_0)*randn(size(u)); % Perform coherent demodulation u_mixed = u_received.*cos(2*pi*f_c*t); % Choose a cutoff frequency in Hertz f_cutoff = f_c/2; % Low pass filter the signal v_reconstructed = func_low_pass_filter(t, u_mixed, f_cutoff); % Plot the results figure(1) subplot(2,2,1,'box','on'); holdon plot(t(1:1000),v(1:1000)); xlabel('t [s]');ylabel('amplitude');title('Message signal'); subplot(2,2,2,'box','on','YLim',[- ceil(max(abs(u(1:1000)))),ceil(max(abs(u(1:1000))))]); holdon plot(t(1:1000),u(1:1000)); xlabel('t [s]');ylabel('amplitude');title('SSBSC signal'); subplot(2,2,3,'box','on','YLim',[- ceil(max(abs(u(1:1000)))),ceil(max(abs(u(1:1000))))]); holdon plot(t(1:1000),u_mixed(1:1000)); xlabel('t [s]');ylabel('amplitude');title('Mixed signal'); subplot(2,2,4,'box','on'); holdon plot(t(1:1000),v_reconstructed(1:1000));
  • 11. xlabel('t [s]');ylabel('amplitude');title('Reconstructed message signal'); figure(2) subplot(2,2,1,'box','on'); pwelch(v,[],[],[],plot_frequency); title('Message signal'); subplot(2,2,2,'box','on'); pwelch(u,[],[],[],plot_frequency); title('SSBSC signal'); subplot(2,2,3,'box','on'); pwelch(u_mixed,[],[],[],plot_frequency);title('Mixed signal'); subplot(2,2,4,'box','on'); pwelch(v_reconstructed,[],[],[],plot_frequency); title('Reconstructed message signal');figure(1)
  • 12. Result : The SSB-SC modulation and demodulation is executed using MATLAB software.
  • 13. Message signal SSBSC signal 1 2 0.5 1 amplitude amplitude 0 0 -0.5 -1 -1 -2 0 0.5 1 0 0.5 1 t [s] t [s] Mixed signal Reconstructed message signal 2 0.5 1 amplitude amplitude 0 0 -1 -2 -0.5 0 0.5 1 0 0.5 1 t [s] t [s]
  • 14. Message signal SSBSC signal 0 0 Power/frequency (dB/Hz) Power/frequency (dB/Hz) -50 -50 -100 -100 0 0.1 0.2 0.3 0.4 0 0.1 0.2 0.3 0.4 Frequency (kHz) Frequency (kHz) Mixed signal Reconstructed message signal 0 0 Power/frequency (dB/Hz) Power/frequency (dB/Hz) -50 -50 -100 -100 0 0.1 0.2 0.3 0.4 0 0.1 0.2 0.3 0.4 Frequency (kHz) Frequency (kHz)
  • 15. 5. PWM MODULATION AND DEMODULATION AIM: To simulate PWM modulation and Demodulation using MATLAB SOFTWARE. EQUIPMENT REQUIRED: 1. MATLAB SOFTWARE 2. PC PROGRAM: %PWM wave generation t=0:0.001:1; s=sawtooth(2*pi*10*t+pi); m=0.75*sin(2*pi*1*t); n=length(s); for i=1:n if (m(i)>=s(i)) pwm(i)=1; elseif (m(i)<=s(i)) pwm(i)=0; end end plot(t,pwm,'-r',t,m,'--k',t,s,'--b');grid; title('PWM wave');axis([0 1 -1.5 1.5]);
  • 16. Result : The PWM modulation and demodulation is executed using MATLAB software.
  • 17. PWM wave 1.5 1 0.5 0 -0.5 -1 -1.5 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
  • 18. 6. ANALOG SIGNAL SAMPLING AND RECONSTRUCTION AIM: To simulate analog signal sampling and reconstruction using MATLAB SOFTWARE. EQUIPMENT REQUIRED: 1. MATLAB SOFTWARE 2. PC PROGRAM: %creating "analog" signal clear; %clears all variables t=0:.1:20;F1=.1;F2=.2; x=sin(2*pi*F1*t)+sin(2*pi*F2*t); %plotting figure(1);subplot(2,1,1);plot(t,x); title('Original signal') xlabel('t');ylabel('x(t)');subplot(2,1,2); x_samples=x(1:10:201); %gets 21 samples of x. stem(x_samples,'filled'); title('Sampled signal');xlabel('n');ylabel('x_s(n)'); axis([0 20 -2 2]); %starting reconstruction process figure(2); subplot(2,1,2);plot(t,x,'black'); holdon; plot([0 20],[0 0],'black'); holdoff; xlabel('t');ylabel('x(t)');title('Original signal'); grid; x_recon=0;subplot(2,1,1); for k=0:length(x_samples)-1 stem(0:length(x_samples)-1,x_samples,'filled'); if k==length(x_samples)-1 title('Reconstruction finished'); else title('Sample by sample reconstruction'); end gridon; l=k:-.1:-20+k; x_recon=x_recon+x_samples(k+1)*sinc(l); axis([0 20 -2 2]); hold; plot(t,x_samples(k+1)*sinc(l),'r') plot(t,x_recon); holdoff; waitforbuttonpress; end
  • 19. Result : The Analog signal sampling and reconstruction is executed using MATLAB software.
  • 20. Original signal 2 1 x(t) 0 -1 -2 0 2 4 6 8 10 12 14 16 18 20 t Sample by sample reconstruction 2 1 0 -1 -2 0 2 4 6 8 10 12 14 16 18 20 Reconstruction finished 2 1 0 -1 -2 0 2 4 6 8 10 12 14 16 18 20 Original signal 2 1 x(t) 0 -1 -2 0 2 4 6 8 10 12 14 16 18 20 t
  • 21. 7. PPM MODULATION AND DEMODULATION AIM: To simulate PPM modulation and demodulation using MATLAB SOFTWARE. EQUIPMENT REQUIRED: 1. MATLAB SOFTWARE 2. PC PROGRAM: fc=50; fs=1000; f1=200;f2=300; t=0:1/fs:((2/f1)-(1/fs)); x1=0.4*cos(2*pi*f1*t)+0.5; subplot(311);plot(x1);title('message signal');GRID; subplot(312);y=modulate(x1,fc,fs,'ppm');plot(y); title('PPM MODULATION'); GRID; z=demod(y,fc,fs,'ppm'); subplot(313);plot(z);title('demodulated o/p');grid;
  • 22. Result : The Pulse Position modulation and demodulation is executed using MATLAB software.
  • 23. message signal 1 0.5 0 1 2 3 4 5 6 7 8 9 10 PPM MODULATION 1 0.5 0 0 20 40 60 80 100 120 140 160 180 200 demodulated o/p 1 0.5 0 1 2 3 4 5 6 7 8 9 10