<< Chapter < Page | Chapter >> Page > |
Since the channel is assumed to be ideal, this is equal to
the received signal
.
This ideal transmitter is simulated in the first part of
idsys.m
.
% encode text string as T-spaced
% PAM (+/-1, +/-3) sequencestr='01234 I wish I were an Oscar Meyer...
wiener 56789';m=letters2pam(str); N=length(m); % 4-level signal of length N
% zero pad T-spaced symbol sequence to create% upsampled T/M-spaced sequence of scaled
% T-spaced pulses (with T = 1 time unit)M=100; mup=zeros(1,N*M); mup(1:M:N*M)=m; % oversampling factor
% Hamming pulse filter with T/M-spaced% impulse response
p=hamming(M); % blip pulse of width Mx=filter(p,1,mup); % convolve pulse shape with data
figure(1), plotspec(x,1/M) % baseband signal spectrumt=1/M:1/M:length(x)/M; % T/M-spaced time vector
fc=20; % carrier frequencyc=cos(2*pi*fc*t); % carrier
r=c.*x; % modulate message with carrier
idsys.m
(part 1) idealized transmission system - the transmitter
(download file)
Since M
atlab cannot deal directly with analog signals,
the “analog” signal
is sampled at
times
the symbol rate, and
(the signal
sampled at times
)
is the vector
r
in the M
atlab code.
The vector
r
is also the input to the digital portion of the receiver.
Thus, the first sampling block in the receiver of
[link] is implicit in the way M
atlab emulates the analog signal.
To be specific,
can be represented as the sum of an integer
multiple of
and some positive integer
smaller than
such that
Since ,
Thus, the received signal sampled at is
The receiver performs downconversion in the second part of
idsys.m
with a mixer
that uses a synchronized cosine wave, followed bya lowpass filter that removes out-of-band signals.
A quantizer makes hard decisions that are then decodedback from symbols to the characters of the message.
When all goes well, the reconstructed message is the same asthe original.
% am demodulation of received signal r
c2=cos(2*pi*fc*t); % synchronized cosine for mixingx2=r.*c2; % demod received signal
fl=50; fbe=[0 0.1 0.2 1]; damps=[1 1 0 0 ]; % design of LPF parametersb=firpm(fl,fbe,damps); % create LPF impulse response
x3=2*filter(b,1,x2); % LPF and scale downconverted signal% extract upsampled pulses using correlation
% implemented as a convolving filtery=filter(fliplr(p)/(pow(p)*M),1,x3); % filter rec'd sig with pulse; normalize
% set delay to first symbol-sample and% increment by M
z=y(0.5*fl+M:M:end); % downsample to symbol ratefigure(2), plot([1:length(z)],z,'.') % soft decisions% decision device and symbol matching
% performance assessmentmprime=quantalph(z,[-3,-1,1,3])'; % quantize to +/-1 and +/-3 alphabetcvar=(mprime-z)*(mprime-z)'/length(mprime), % cluster variance
lmp=length(mprime);pererr=100*sum(abs(sign(mprime-m(1:lmp))))/lmp, % percentage symbol errors
% decode decision device output to text stringreconstructed_message=pam2letters(mprime) % reconstruct message
idsys.m
(part 2) idealized transmission system - the receiver
(download file)
Notification Switch
Would you like to follow the 'Software receiver design' conversation and receive update notifications?