C_Stottlemeyer_ECET375_WK3_lab

.docx

School

DeVry University, Chicago *

*We aren’t endorsed by this school

Course

375

Subject

Electrical Engineering

Date

Jun 4, 2024

Type

docx

Pages

16

Uploaded by cls8879

WEEK 3 LAB ECET 375 MARCH 25, 2019 CHRIS STOTTLEMEYER
1 Experiments: 1) The Matlab function dec2base(str,n,m) is very helpful in converting characters into a string of m digit string in base n. For example, dec2base(‘a’, 2, 8) will convert the ASCII code for ‘a’ into an 8 bit binary number expressed as a string of 8 bits. Since we have four symbols, one for two bits, we use the dec2base(str,4,4) function. The following sequence of commands (which are part of script file str2pam.m) is the basis for letters to symbol conversion. What do you see when you run this script? What do you expect the binary code for the letter ‘n’ to be? What are its 4-PAM symbols? A.) Binary code for the letter ‘a’ is 01100001 4-PAM symbols are [-1, 1, -3, -1] 1) Change the str variable in the script to ‘Pay $200’. Run the code and record the output. What is the output? How many symbols are there? What is the code for $ sign? What is the relationship between the number of symbols and the number of letters? A.) 01010000 01100001 01111001 00100000 00100100 00110010 00110000 00110000 4 digits base 4 for ‘Pay $200’ are 1100 1201 1321 0200 0210 0302 0300 0300 Multiply by 2 98 98 96 96 98 100 96 98 98 102 100 98 96 100 96 96 96 100 98 96 96 102 96 100 96 102 96 96 96 102 96 96
2 4-PAM symbols are -1 -1 -3 -3 -1 1 -3 -1 -1 3 1 -1 -3 1 -3 -3 -3 1 -1 -3 -3 3 -3 1 -3 3 -3 -3 -3 3 -3 -3 1. Transforming Symbols to Signals In this step, we convert the symbols into signals for transmission. Ideally we want to choose such signals that: i) cause no inter-symbol interference (ISI; i.e., the value of the message at a given time does not interfere with the value of the message at other times) ii) are efficient in terms of bandwidth usage iii) are not adversely affected by noise that is invariably present in transmission systems The program given below generates and displays rectangular, Hamming, sync, and square-root raised cosign (SRRC) pulse shapes and their spectrum. The following program illustrates the example pulse shapes: %% ECET-375 Lab-2: pulseShapes.m %%generate symbols % Create a random +/- L-PAM source symbol sequence with % length N and variance 'Var' L=4; Var=5; N=1000; s=2*floor(L*rand(1,N))-L+1; s=s*sqrt(3*Var/(L^2-1)); %oversample by M points to simulate analog system M=20; ovrSampled=zeros(1,N*M); ovrSampled(1:M:end)=s % oversampling by factor of M pulseChoice = 'srrc' % 'Rectangle' 'Hamming' 'Sync' 'rc, 'srrc' switch (lower(pulseChoice)) case 'hamming' % Generate hamming pulse extent = 1;
3 pulseSig=hamming(extent*M); pulseShapeTitle = 'Hamming Pulse' ; case 'rectangle' %generate pulses used to convert symbols into signals pulseSig=ones(1,M); % rectangular/square pulse width M pulseShapeTitle = 'Rectangular Pulse' ; case 'sync' f6db=10; % 6db width of the sync pulse beta=1e-8; %zero for beta in raised cosine signal yields sinc pulse indx=-4/(2*f6db)+1e-8:1/(10*2*f6db):4/(2*f6db)+1e-8; % sampling indices pulseSig=(sin(2*pi*f6db*indx)./(2*pi*f6db*indx)).*(cos(2*pi*beta*f6db*indx)./(1- (4*beta*f6db*indx).^2)); pulseShapeTitle= 'Sync Pulse' case 'srrc' % Generate a Square-Root Raised Cosine Pulse beta=0.3; % try different values for the roll-off factor; a value of 0 yields the sinc pulse f6db=10; % 6db width of the sync pulse indx=-4/(2*f6db)+1e-8:1/(10*2*f6db):4/(2*f6db)+1e-8; % sampling indices pulseSig=(sin(2*pi*f6db*indx)./(2*pi*f6db*indx)).*(cos(2*pi*beta*f6db*indx)./(1- (4*beta*f6db*indx).^2)); pulseShapeTitle= 'SRRC Pulse' otherwise % Generate hamming pulse extent = 1; pulseSig=hamming(extent*M) %ones(1,M); pulseShapeTitle = 'Hamming Pulse' ; end %Simulate the received signal recSig=filter(pulseSig,1,ovrSampled); % convolve pulse shape with oversampled signal tt=1/M:1/M:length(pulseSig)/M; figure(1)
4 subplot(3,1,1), plot(tt,pulseSig) ylabel( 'Pulse shape' ) xlabel( 'one sample period' ) title(pulseShapeTitle) [h,w]=freqz(pulseSig); subplot(3,1,2), semilogy(w/pi,abs(h)) ylabel( 'Pulse spectrum' ) xlabel( 'normalized frequency' ) fftx=abs(fft(recSig)); subplot(3,1,3), semilogy(2*(1:length(fftx)/2)/length(fftx),fftx(1:length(fftx)/2)) ylabel( 'Waveform spectrum' ) xlabel( 'normalized frequency' ) Experiments: The pulseShapes.m program shown above has capability to display one of the four pulse shapes (Hamming, rectangle, Sync, or SRRC) and its spectrum. 1) Make the choice of one of Hamming, Rectangle, Sync, or SRRC one at a time. Save the graphs you obtain for each in your lab report. Which pulse shape produces the smallest bandwidth? Which pulse shape has the widest bandwidth?
5 SRRC has the smallest pulse. Hamming has the widest. 2) Which pulse shape has widest span in the time-domain? Which pulse shape has the narrowest span in the time-domain? A.) Hamming pulse has widest span in the time domain and Rectangular has the narrowest span. 2. Eye Diagrams The inter-symbol interference (ISI) occurs when signals of adjacent symbols interfere with each other. This may occur when the pulse shapes used for symbols are wider than the time allocated for one symbol. It is like a radio program that continues beyond its allotted time and into the next program’s time slot. Another reason for ISI is that a noisy channel impairs the signals (for example, causes unequal phase delays for different input frequencies) so much that they spill over to adjacent channels. The ISI may cause the receiver to incorrectly decode the bits from the signals. The eye diagram is a visual tool that can be used to understand the extent of impairments to the transmitted signal. If you overlay the traces of received signal for every n symbols (that is, if you restart the trace on an oscilloscope every nT seconds) without erasing the previous traces, the picture you see is the eye diagram. The abscissa displays the time for n symbols, and the ordinate displays the received signal amplitude. As the number of overlaid traces increases, the eye diagram becomes thicker and can show how the effects of noise, channel impairments, and other detrimental factors contribute to the difficulty of correctly determining the transmitted message. The following Matlab program illustrates the generation of eye diagrams for different pulse shapes. %% ECET-375 Lab-3: eyeDiagrams.m %%generate symbols
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help