How to generate qpsk
Afficher commentaires plus anciens
Hi, I have a function to generate a BPSK signal below. Similarly, I also want to generate a QPSK signal. Can anyone assist me with this, please.
The code for the BPSK generator is below;
function [ bpskSignal ] = BPSK_Generator( rBinary )
N=10;
Fc=2; Fs=4; nCycles=1; Tb=nCycles/Fc; t=0:1/Fs:(nCycles-1/Fs); xC=cos(2*pi*t);
A=1; Eb=(A^2*Tb)/2; Eb_N0dB=0:2:14; Eb_N0=10.^(Eb_N0dB/10); nVar=(Eb)./Eb_N0;
bitStream = []; carrierSignal = []; i = 1; while(i<=N) if(rBinary(i)) bitStream = [bitStream ones(1,length(xC))]; else bitStream = [bitStream zeros(1,length(xC))]; end carrierSignal = [carrierSignal A*xC]; i = i+1; end bits = 2*(bitStream - 0.5) bpskSignal = carrierSignal.*bits;
end
Réponses (0)
Catégories
En savoir plus sur QPSK dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!