% EE3150 Communication Systems Lab % Experiment 7 Design of a Communication System % E.Cura diary myproject.txt SSN=input('Enter your Student I.D. number (SSN, without dashes):'); ms=SSN-100*floor(SSN/100); SSN=(SSN-ms)/100; ms1=SSN-100*floor(SSN/100); SSN=(SSN-ms1)/100; ms2=SSN-100*floor(SSN/100); SSN=(SSN-ms2)/100; ms3=SSN-100*floor(SSN/100); % Selection of modulation scheme if ms<=50, disp(' 1) Modulation method: DSB with coherent demodulation'); C=5; else disp(' 1) Modulation method: AM with envelope detection'); disp(' Modulation index m = 0.5'); C=13; end % Selection of bandwidth for the LPFs fc=ms1/10+2; s=sprintf(' 2) Cutoff frequency for LPFs, fc = %1.1f kHz',fc); disp(s); % Selection of frequency for the modulating signal fx=round(sqrt(fc)*10)/10; s=sprintf(' 3) Message frequency, fx = %1.1f kHz',fx); disp(s); % Selection of carrier frequency fs=round(ms2/10)*fx*C; while (fs<200)&(ms>50), fs=2*fs+fx; end while (fs<50)&(ms<=50), fs=2*fs+fx; end s=sprintf(' 4) Carrier frequency, fs = %1.1f kHz',fs); disp(s); % Selection of gain for output filter if ms3<=25, K=1; end if (ms3>25)&(ms3<=50), K=2; end if (ms3>50)&(ms3<=75), K=3; end if (ms3>75)&(ms3<=99), K=4; end s=sprintf(' 5) Gain for active LPF, K = %d dB',K); disp(s); diary off