Professional Documents
Culture Documents
Visualization The Noise at Signals: Example 1
Visualization The Noise at Signals: Example 1
Práctice
Visualization and recognition of signals with noise in the frequency and time domain using
MATLAB.
Objetives:
Develop:
The rand and randn functions, predefined in MATLAB, generate pseudorandom numbers of
uniform and normal distribution respectively. Therefore, we can add random noise signal to
any normal distribution following the procedure shown in Example 1.
Example 1:
% Add noise to a sine wave using random numbers (randn - normal distribution)
>> randn('state',0);
>> subplot(211)
>> plot(t,g)
A more convenient way to add Gaussian white noise signal is to use the predefined functions
wgn and awgn. If we simply want to generate a vector signal with white noise, we can use the
wgn function (see Example 2)
Example 2:
% 'Noise Vector' 1000 elements and 2 dBm power
>> plot(t,noise)
The function awgn generates noise for a given value of SNR. Thus, we can simulate the pass of
the signal through a channel with certain characteristics of noise. In Example 3 we define a
square signal and add a signal / noise ratio SNR = 15dB:
Example 3:
>> subplot(211)
>> plot(t,g)
>> subplot(212)
>> plot(t,g_noise)
In the following example (Example 4) we define a sinusoid with a signal / noise ratio
SRN=20dB:
Radiocommunications Systems
2º CFGS Sistemas Telecomunicación e Informática
Alvaro Giribet
Example 4:
% Add Noise AWGN to a square signal with SNR = 20 dB
>> subplot(311)
>> plot(t,g)
>> subplot(312)
>> plot(t,g_noise)
>> subplot(313)
Once the examples made, and understood with the conclusions in memory, you must do the
following:
Exercise 1:
1st Perform a sinusoidal signal frequently 100Hz, where it is drawn on the screen at least 2
cycles of the same, and at most 10.
2nd Add to this a Gaussian noise signal by the two methods studied, and on the screen
represent the three signals.
Exercise 2:
1st Perform a square signal with frequency 100Hz, where it is drawn on the screen at least 2
cycles of the same, and at most 10.
2nd Add to this signal a Gaussian noise with SNR = 35dB by the two methods studied, and
represent on the screen the three signals.