clc; clear all; close all; Eb=1; Es=2*Eb; Tb=1e-6; bit_rate=1/Tb; fc=bit_rate; Ts=2*Tb; data=[1 0 1 1 0 0 1 1 0 1]; % information data_nrz=2*data-1; stem(data);%plotting data grid on; title('plot of digital data signal'); xlabel('time'); ylabel(' amplitude'); axis([0 11 0 1.5]); % basis signals for QPSK t=[0:Tb/100:Tb]; b1=sqrt(2/Ts)*cos(2*pi*fc*t); b2=sqrt(2/Ts)*sin(2*pi*fc*t); y=[]; for i=1:length(data)/2 y=[y sqrt(Es)*data_nrz(i)*b1-sqrt(Es)*data_nrz(i+1)*b2]; end figure plot(y) grid on; title('QPSK modulated signal (sum of inphase and Quadrature phase signal)'); xlabel('time(sec)'); ylabel(' amplitude'); spectrum=fft(y); N=length(y); f=(-N/2:N/2-1)/N; figure plot(f,abs(spectrum)) grid on title('frequency spectrum of QPSK modulated signal'); xlabel('frequency'); ylabel(' amplitude');