From: Tara on
Hi,
I have some data in time domain that i need to convert to power
spectral density. I have used FFT transform but i am not sure what will
be the units for y axis in the power spectrum and how is it related to
number of samples taken.
I know psd function but i don't know how to use it using the data from
time domain.

Also for this examples how do i relate the untis in y axis

t = 0:0.001:0.4;
k=1*sin(2*pi*50*t);
Y = fft(k,512);
Pyy = Y.* conj(Y) / 512;
f = 1000*(0:256)/512;
figure (1);
plot(f,Pyy(1:257))


f 2= 50;
Fs = 1000;
y = 1*sin(2*pi*f2/Fs*(0:256));
figure (2);
psd(y,512,Fs,512);

Thanks