Determining if given random processes are stationary processes(WSS) or not with statistical analysis MATLAB.
Converting an analog signal to digital to transfer & receive it in MATLAB.
Let's start by sampling from the random processes mentioned above at a frequency of
Mean of |
Mean of |
---|---|
Here are the exact values of the mean calculated manually.
By increasing the number of samples in
Sample Size | Autocorrelation function of |
Autocorrelation function of |
---|---|---|
100 | ||
1000 |
Here are the exact values of the autocorrelation function calculated manually.
By analyzing the diagrams from the standpoint of a constant time difference (
However, in the case of
In this section, the
To begin, an analog signal
Analog Signal | Sampled Signal |
---|---|
To perform uniform quantization, the range of the sampled signal amplitude was divided into 33 levels. The process was implemented using the following code.
N = 33;
lines = linspace(min(g_sample),max(g_sample),N);
quantization = zeros(1,length(g_sample));
hold on
for k=1:length(lines)
yline(lines(k));
end
for i=1:length(quantization)
for j=1:length(lines)-1
mean_two_line = (lines(j+1)+lines(j))/2;
if(g_sample(i) >= lines(j) && g_sample(i) <= lines(j+1))
quantization(i) = mean_two_line;
end
end
end
Quantization levels | Quantized Signal |
---|---|
This section describes the procedure of transmitting signals from the transmitter to the receiver using PAM (Pulse Amplitude Modulation) principles. For each quantized point (Digit or Symbol), the base pulse is multiplied by a specific range before transmission.
Base Pulse | Modulation Result | Modulation Result (Zoomed) |
---|---|---|
The receiver will receive the signal along with noise, which is assumed to follow a normal random process. The Signal-to-Noise Ratio (SNR) is assumed to be 2dB.
noise = normrnd(0,0.48,[1,length(modulate_signal)]);
signal_with_noise = modulate_signal + noise;
Here is the received signal with the aforementioned noise.
A policy has been implemented to convert the pulses into their corresponding digits, with the knowledge that each digit is sent in 1 second. The basic pulse is multiplied in the received pulse string for every second. By calculating their mutual energy and considering the energy of the basic pulse, the amplitude of each of these pulses is determined.
for i=1:length(bits)
noise_pulse = signal_with_noise(((i-1)*1000)+1:i*1000).*pulse;
energy_each_pulse(i) = sum(noise_pulse) / energy_pulse;
end
Now, the energy_each_pulse values are compared with the two-dimensional array obtained from the Digitizing section in order to derive the quantization level.
for i=1:length(energy_each_pulse)
nearest_odd_number = energy_each_pulse(i);
is_odd = mod(nearest_odd_number,2) < 1;
nearest_odd_number = floor(nearest_odd_number);
nearest_odd_number(is_odd) = nearest_odd_number(is_odd)+1;
energy_each_pulse(i) = nearest_odd_number;
for j=1:length(lines)-1
if (energy_each_pulse(i) == TwoD_array(1,j))
decode_signal(i) = TwoD_array(2,j);
end
end
end
- Course: Principles of Communication Systems [ECE 891]
- Semester: Fall 2022
- Institution: School of Electrical & Computer Engineering, College of Engineering, University of Tehran
- Instructors: Dr. Sabaghian