I am trying to calculate the PSD from the autocorrelation. I am finding the following problems doing this (it is mandatory for me using this autocorrelation):
- The test 1 is verified. I used the same division that are placed in this documenthttp://aaronscher.com/Course_materials/Communication_Systems/documents/PSD_Autocorrelation_Noise.pdf, but unfortunately I am not sure why the psd should by divided by the length of the signal instead of the length of the autocorrelation.
- The Parseval theorem (%parseval failed) is failed so I am wandering if this means that my division are not correct. If I apply the parseval theorem using the normalization %parseval passed, the test is passed. So can you help me to understand if my "normalization" is wrong.
I hope you can help me. I tried a lot of time to find the right normalization.
clear; clc; close all;
v_c=dlmread('v_c.txt', '\t', 1, 0)
freq =transpose( -Fs/2:Fs/length(r1):Fs/2-(Fs/length(r1)));
PSDfromr1 = abs(fftshift(fft(r1)))*(1/((length(v1))))