"Bum" <
[email protected]> skrev i en meddelelse
news:
[email protected] ...
> Does anyone know of a PSD calculating routine other than in Matlab?
>
I assume you are familiar with complex numbers.
If you have a sequence x of numbers where x(1) is the first number and x(N)
is the last number in
your sequence then you can calculate the power spectrum X like this:
for k=1 to N
tmp_sum=0
for n=1 to N
tmp_sum=tmp_sum+x(n)*exp(-j*2*pi*(k-1)*(n-1)/N)
end
X(k)=abs(tmp_sum)^2
end
It's not an optimal way of doing it, but it's straightforward and easy to
understand.