Why the length of power spectrum is fixed at 4096 when the signal’s length varies ?
I was using pspectrum function to obtain the power spectrum of time series signals. However, I find that when I set different length of time series signal, the power spectrum return by the pspectrum function has fixed length 4096. I want to konw what underlying mechanism is causing this result ?
diffSignalLengths = 50:50:5000; % different signal length for experiment
Fs = 3e3; % sampling frequency
lenPS = zeros(numel(diffSignalLengths),1);
for ii = 1:numel(diffSignalLengths)
x = rand(diffSignalLengths(ii),1);
P = pspectrum(x,Fs);
lenPS(ii) = length(P);
end
disp(all(lenPS == 4096))I was using pspectrum function to obtain the power spectrum of time series signals. However, I find that when I set different length of time series signal, the power spectrum return by the pspectrum function has fixed length 4096. I want to konw what underlying mechanism is causing this result ?
diffSignalLengths = 50:50:5000; % different signal length for experiment
Fs = 3e3; % sampling frequency
lenPS = zeros(numel(diffSignalLengths),1);
for ii = 1:numel(diffSignalLengths)
x = rand(diffSignalLengths(ii),1);
P = pspectrum(x,Fs);
lenPS(ii) = length(P);
end
disp(all(lenPS == 4096)) I was using pspectrum function to obtain the power spectrum of time series signals. However, I find that when I set different length of time series signal, the power spectrum return by the pspectrum function has fixed length 4096. I want to konw what underlying mechanism is causing this result ?
diffSignalLengths = 50:50:5000; % different signal length for experiment
Fs = 3e3; % sampling frequency
lenPS = zeros(numel(diffSignalLengths),1);
for ii = 1:numel(diffSignalLengths)
x = rand(diffSignalLengths(ii),1);
P = pspectrum(x,Fs);
lenPS(ii) = length(P);
end
disp(all(lenPS == 4096)) digital signal processing, power spectrum MATLAB Answers — New Questions