Autocorrelation and PSD (Wiener Khinchin Theorem) FFT Amplitude Scaling Problem
12 views (last 30 days)
Show older comments
I've recently been working on creating on generating a random equiprobable polar NRZ signal (or Polar PAM). I'm attempting to compute its autocorrelation function and then its power spectral density (PSD) through the wiener-khinchin theorem. Theoretically the autocorrelation function of a bipolar NRZ signal is given as:

where A is the amplitude of the signal and T is the bit duration. Assuming A = 5 and T = 1 (meaning a bit rate of 1 bps). The following is the signal of the polar nrz signal using 100 bits and 10 samples per bit.

Below is the biased autocorrelation function (ACF). Rx(0) = 25 which was expected in the theoretical formula. Also the ACF has a triangular shape between tau = [-1 1]. This works fine.

[ACF,tau] = xcorr(obj.bit_stream,'biased');
tau = obj.sampling_period*tau;
figure;
plot(tau,ACF);
With more samples

Lastly, I computed the PSD using MATLAB's fft function. Below is the PSD shown

N = length(ACF);
fshift = (-N/2+0.5:N/2-0.5)*((obj.sampling_rate)/N);
df = fshift(2)-fshift(1);
PSD = abs((fftshift(fft(ACF))));
figure;
plot(fshift,PSD);
title('Graph 1');
xlim([-20 20]);
The shape looks fine and looks even more like a sinc^2 function as I increase the number of bits. The nulls of the sinc^2 function are also correct at f = 1,2.3...n assuming T = 1. Some aliasing did occur but didnt really affect the amplitude, The only problem is the amplitude. According to the theoretical equation above, sinc^2(0) should have a value of A^2 * T = 25.
Please note, I have tried scaling by multiplying the PSD with the following :
- sampling time (dt),
- dt^2
- df (df = fs/N)
- df^2
- (1/N), where N is the length of the ACF,
- 1/(sqrt(N)),
- 1 / (N*fs), where fs is the sampling frequency
- 1/(N^2).
- 1
When I tried scaling with dt, the parseval's power theorem was correct as shown below
N = length(ACF);
fshift = (-N/2+0.5:N/2-0.5)*((obj.sampling_rate)/N);
PSD = obj.sampling_time*abs((fftshift(fft(ACF))));
df = fshift(2)-fshift(1);
P_avg_TD = (sum(abs(obj.bit_stream).^2))*(obj.sampling_period/obj.time(end));
P_avg_FD = sum(PSD)*df;
disp(["The Time Domain Power is",P_avg_TD]);
disp(["The F-Domain Power is ",P_avg_FD]);
Both gave a power value of 25.
So my only concern is the amplitude scaling. I would appreciate any help as I've been working on this matter for a while now.
0 Comments
Answers (0)
See Also
Categories
Find more on Parametric Spectral Estimation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!