psd-ber

Download psd-ber

If you can't read please download the document

Upload: amirsyah-rayhan-mubarak

Post on 04-Dec-2015

217 views

Category:

Documents


4 download

DESCRIPTION

psd-ber

TRANSCRIPT

%XXXXXXXXXX PSD compare of BPSK, QPSK, GMSK XXXXXXXXXXpi = 3.141592;sqrpi = pi^2;GMSK = [];GBPSK = [];GQPSK = [];xaxis = [];GQAM_A = [];GQAM_B = [];for i=1:1000 f = i/100; % f is frequency normalized to to 1/(bit duration) xaxis = [xaxis, f ]; ymsk = 16/sqrpi * (cos(6.2832 * f))^2/ (1- 16 * f^2)^2; GMSK = [GMSK, 10 * log10(ymsk)]; ybpsk = 2 * (sin(pi*f)/(pi*f))^2; GBPSK = [GBPSK, 10 * log10(ybpsk)]; yqpsk = 2 * (sin(2*pi* f)/(2*pi*f))^2; GQPSK = [GQPSK, 10 * log10(yqpsk)]; yqam_A = 2 * log2(16)*(sin(pi*f*log2(16))/(pi*f*log2(16)))^2; GQAM_A = [GQAM_A, 10 * log10(yqam_A)]; yqam_B = 2 * log2(64)*(sin(pi*f*log2(64))/(pi*f*log2(64)))^2; GQAM_B = [GQAM_B, 10 * log10(yqam_B)]; endfigure (2)plot(xaxis,GMSK, 'b-',xaxis,GBPSK, 'g-',xaxis,GQPSK, 'm-',xaxis,GQAM_A, 'y-',xaxis,GQAM_B, 'c-');axis([0 10 -60 10]);title('Spectral Power vs Bit Rate');ylabel('Spectral Power Level (dB)');xlabel('Frequency Offset / Bit Rate');legend('GMSK','BPSK','QPSK','16 QAM','64 QAM');%XXXXXXXXXX BER Curve for BPSK,QPSK,16 QAM XXXXXXXXXXEbNo = (0:16)';M = 4;berP = berawgn(EbNo,'psk',M,'nondiff');berM = berawgn(EbNo,'msk','off','coherent');berQ = berawgn(EbNo,'qam',M^2);berA = berawgn(EbNo,'qam',M^3);figure (3)semilogy(EbNo,[berP berM berQ berA])title('BER vs SNR curve');xlabel('Eb/No (dB)')ylabel('Bit Error Rate')legend('BPSK and QPSK','MSK and GMSK','16 QAM','64 QAM')grid