Using a MATLAB program,
Create a function graph (function, xmin, xmax) that draws a graph within a given range of x values (xmin to xmax).
snr=0:1:15; for ii=1:length(snr) x=randint(1,100000); % Generating bits y=pskmod(x,2); % Generating BPSK modulated data ynoisy=awgn(y,snr(ii)); % Adding AWGN noise to data z=pskdemod(ynoisy,2); % Demodulating error(ii)=length(find(x-z~=0)); end semilogy(snr,error) hold snr=0:1:15; for ii=1:length(snr) x=randint(1,100000); % Generating bits y=pskmod(x,4); % Generating QPSK modulated data ynoisy=awgn(y,snr(ii)); % Adding AWGN noise to data z=pskdemod(ynoisy,4); % Demodulating error(ii)=length(find(x-z~=0)); end semilogy(snr,error) grid
Get Answers For Free
Most questions answered within 1 hours.