A list,











Ii. Source code

clear all close all i=5; %5 symbols j=5000; T = linspace (0, 5, j); 5000 point row vectors are generated between %0 and 5, namely divided into 5000 parts fc=2; FM = I /4; Bit-rate % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % produces baseband signal x = rand (1, I)) % rand function generated in a random number between 0 and 1, a total of 1 to 10 a = round (x); % random sequence, round takes the nearest integer st=t; for n=1:i if a(n)<1; for m=j/i*(n-1)+1:j/i*n st(m)=0; end else for m=j/i*(n-1)+1:j/i*n st(m)=1; end end end figure(1); subplot(221); plot(t,st); The axis ([0, 5, 0.2, 1.2]). Title (' baseband signal '); S1 = % carrier cos (2 * PI * fc * t); subplot(222); plot(t,s1); The axis ([0, 5, 1, 1]). The script file f2t. m defines the function F2T to compute the inverse Fourier transform of the signal. function [t,st]=F2T(f,sf) %This function calculate the time signal using ifft function for the input %signal's spectrum df = f(2)-f(1); Fmx = ( f(end)-f(1) +df); dt = 1/Fmx; N = length(sf); T = dt*N; %t=-T/2:dt:T/2-dt; t = 0:dt:T-dt; sff = fftshift(sf); st = Fmx*ifft(sff); function [t,st]=lpf(f,sf,B) %This function filter an input data using a lowpass filter %Inputs: f: frequency samples % sf: input data spectrum samples % B: lowpass's bandwidth with a rectangle lowpass %Outputs: t: time samples % st: output data's time samples df = f(2)-f(1); T = 1/df; hf = zeros(1,length(f)); % all zero matrix bf = [-floor(B/df): floor(B/df)] + floor(length(f)/2); hf(bf)=1; yf=hf.*sf; [t,st]=F2T(f,yf); st = real(st);Copy the code

3. Operation results



The code downloadwww.cnblogs.com/ttmatlab/p/…