How to solve this xy error code?
Show older comments
I am using Matlab R2008a and I type this code:*
>> %mencari nilai PSD dari data suara Odontoceti (Spinner - 2.wav)
[y,fs]=wavread('Spinner - 2.wav');
[pyy,f]=PSD(xy,256,fs,hamming(256),128,'none');
ys = 10*log10(pyy);
figure(1)
plot (f,ys,'k.-')
grid no
xlabel ('Frekuensi (Hz)')
ylabel ('PSD (dB/Hz)')
title ('Spinner 2')
but i got an error code like this:
??? Undefined function or variable 'xy'.
please help me how to solve this. thankyou
2 Comments
madhan ravi
on 9 Nov 2018
Edited: madhan ravi
on 9 Nov 2018
Upload .wav file by clicking the paper clip button
Anggit Raudina
on 9 Nov 2018
Answers (1)
Walter Roberson
on 9 Nov 2018
After
[y,fs]=wavread('Spinner - 2.wav');
Add
xy = y(:, 1);
2 Comments
Anggit Raudina
on 9 Nov 2018
Walter Roberson
on 9 Nov 2018
Please show the output of
D = dir('*.wav');
N = {D.name};
N{:}
Categories
Find more on Signal Generation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!