Random signals newbie exercise
5 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi! I'm new to Matlab and i am attending some laboratories in my university. Trying to figure out what an exercise wants from me ! Here's the exercise and some code i've made. Explanations are well received !
" The objective of this section is to show how two signals that “look” similar can be distinguished by computing their average over a large interval. This type of technique is used in signal demodulators to distinguish between the digits “1” and “0”.
Generate two discrete-time signals called sig1 and sig2 of length 1, 000. The samples of sig1 should be independent, Gaussian random variables with mean 0 and variance 1. The samples of sig2 should be independent, Gaussian random variables with mean 0.2 and variance 1. Use the Matlab command random or randn to generate these signals, and then plot them on a single figure using the subplot command. (Recall that an alternative name for a Gaussian random variable is a normal random variable.)
Next form a new signal “ave1(n)” of length 1, 000 such that “ave1(n)” is the average of the vector “sig1(1:n)” (the expression sig1(1:n) returns a vector containing the first n elements of “sig1”). Similarly, compute “ave2(n)” as the average of “sig2(1:n)”. Plot the signals “ave1(n)” and “ave2(n)” versus n on a single plot. Refer to help on the Matlab plot command for information on plotting multiple signals. "
sig1=randn(1,1000); %random variables with mean 0 and variance 1 subplot(2,1,1); stem(sig1);
sig2=randn(1,1000) + 0.2; %random variables with mean 0.2 and variance 1 subplot(2,1,2); stem(sig2);
above is the code for the first 2 paragraphs, but the third what does it mean?
0 Kommentare
Antworten (0)
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!