clear; fraction = 1/3; bitRate = 270833.0 + fraction sampleRate = bitRate * 256; % 69333333.0 MSPS decimation = sampleRate/(4 * bitRate); basebandBW = .5 * sampleRate/decimation; %baseband band width processingGain = decimation; S = .5; %average signal power %test for Eb/No = 1 to 8 dB EbNo_start = 1; EbNo_end = 8; for EbNo_dB = EbNo_start:EbNo_end %Calculate the noise power EbNo = 10^(EbNo_dB/10); %sgma^2 at baseband = N = No * B where B is noise bandwidth %Signal power = S = Eb/R %(S/N)= EbNo(R/B) %N = (S*B)/(EbNo*R) basebandNoise = (S * basebandBW)/(EbNo * bitRate); %multiple by processing gain to determine IF noise IFNoise = basebandNoise * processingGain; theo_err_prb(EbNo_dB) = Qfunct(sqrt(2 * EbNo)) %reset random number generator so work with same data on all simulations rand('state', 0); DDC_BER(EbNo_dB) = bpskWithDDCChannelizer(sampleRate, sampleRate/8, bitRate, IFNoise, 40) %reset random number generator so work with same data on all simulations rand('state', 0); FFT_BER(EbNo_dB) = bpskWithFFTChannelizer(sampleRate, sampleRate/8, bitRate, IFNoise, 40) end figure; semilogy((EbNo_start:EbNo_end),theo_err_prb, 'b-', (EbNo_start:EbNo_end), DDC_BER, 'g--', (EbNo_start:EbNo_end), FFT_BER,'m:'); ylabel('Probability of Bit Error') xlabel('Eb/No') legend('Theoretical Performance', 'Performance with DDC Approach', 'Performance with FDF Approach');