A list,











Ii. Source code

clear all
close all
i=5; %5A code element j =5000;
t=linspace(0.5,j); %0- 5between5000A dot row vector is divided into5000Copy of the fc =2; % Carrier frequency FM = I /4; Bit-rate % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % produces baseband signal x = rand (1, I))%rand function generated in0- 1Between random number, total1- 10A 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);
axis([0.5.0.2.1.2]);
title('Baseband signal'); S1 = % carriercos(2*pi*fc*t);
subplot(222);
plot(t,s1);
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 signalusing 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



Fourth, note

Version: 2014a complete code or write plus 1564658423