Skip to main content

MATLAB code for ask fsk and psk


Visit Main Website [Click Here ↗]


 

MATLAB Script


%%% Code starts here %%%

clc; clear all; close all;
carrier_frequency=5; %Hz
carrier_frequency2=7; %Hz This will be utilized for FSK's second carrier
x=[1 0 0 1 1 0 0 1] % input signal ;
length=size(x,2);
 
i=1;
while i<length+1
     t = i:0.001:i+1;
    if x(i)==1
       ask=sin(2*pi*carrier_frequency*t);
       fsk=sin(2*pi*carrier_frequency*t);
       psk=sin(2*pi*carrier_frequency*t);
    else
        ask=0;
        fsk=sin(2*pi*carrier_frequency2*t);
        psk=sin(2*pi*carrier_frequency*t+pi);
    end
   
    
    subplot(3,1,1);
    plot(t,ask);
    hold on;
    grid on;
    axis([1 10 -1 1]);
 title('Amplitude Shift Key')
    subplot(3,1,2);
    plot(t,fsk);
    hold on;
    grid on;
    axis([1 10 -1 1]);
title('Frequency Shift Key')
 
    subplot(3,1,3);
    plot(t,psk);
    hold on;
    grid on;
    axis([1 10 -1 1]);
 title('Phase Shift Key')
 
    i=i+1;
 end

%%% Code ends here %%%



Comments

Popular posts from this blog

JS Code to Add a Dropdown Menu to Your Google Blogger

HTML Code < link rel = "stylesheet" href = "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" /> < div class = "topnav" id = "myTopnav" > < div class = "dropdown" >     < button class = "dropbtn" >< b > Mechanism of wireless communication </ b >       < i class = "fa fa-caret-down" ></ i >     </ button >     < div class = "dropdown-content" > < a href = "https://www.salimwireless.com/2022/05/mechanism-of-wireless-communication.html" >< b > Mechanism of wireless communication - step by step </ b ></ a > < a href = "https://www.salimwireless.com/2021/11/pathloss-in-wireless-communication.html" >< b > Pathloss &amp; Delay spread in Modern Wireless Communication Systems </ b ></ a > < a href = "https://www.salimwireless.com/2...

SSC JE Previous Year Question Papers with Solutions

  Question:  Determine the separation between the plates (in mm) of a parallel plate capacitor placed in air, when the area of the plates is 0.002 sq. meter, the voltage of the battery connected to this parallel plate capacitor is 4 V and the charge stored on the plates is 16 pC. Answer: We know that C = Q/V or, C=(16*10^(-12)) / 4 or, C = 4*10^(-12) Capacitance between two parallel plates is calculated as, C = €A/d Where, € = 8.854*10^(-12) A = Area of plate d = Distance between plates Now, d = €A/C or, d = (8.854*10^(-12)*0.002) / (4*10^(-12)) or, d = 4.4 mm Next>> <<Previous Go back