help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Questions about signal analysis


From: Ahmed Husain ?Abbas Mohamed Sahrab
Subject: Questions about signal analysis
Date: Mon, 31 Oct 2016 20:54:20 +0000

Hello


I've got a question about finding the PSD (Power Spectral Density) in octave, I looked at the documentation and used the following code to find it.


[y, fs] = audioread("song1.wav");

NFFT=32768;  %Sample Size
F=fft(y,NFFT);
F_Shift=fftshift(F); %Shifting the FFT
fVals=fs*(-NFFT/2:NFFT/2-1)/NFFT; %To adjust the X axis to suit the plot

hold on


L=length(y); %Finds the length of the y variable which is a vector
Px=F_Shift.*conj(F_Shift)/(NFFT*L);   
figure  
plot(fVals,Px,'r'); 
title('Power Spectral Density');  
xlabel('Frequency in Hertz')  
ylabel('Power');

I'm wondering if there is a separate command to commute the PSD and the power spectrum, and my second question is how to pick the frame size. 



Best Wishes


Ahmed Suhrab


reply via email to

[Prev in Thread] Current Thread [Next in Thread]