How to stem plot frequencies of an audio file?
6 views (last 30 days)
Show older comments
I've been trying to audio read a file and then to plot the frequency on the y axis but I've had no luck. This is what I'm getting
But I need to get this
Here's my code
[data,Fs]=audioread('mysn.wav');
sound(data,Fs); % see what it sounds like */
N=length(data)
n=0:N-1;
x=transpose(data);
X=fft(x);
X_mag=abs(X);
z=max(X_mag);
N_2 = (N/2);
gh=find(X_mag(1:N_2)>10543)
gk=gh.*(Fs/N)
stem(gk)
2 Comments
Geoff Hayes
on 29 Nov 2015
Jim - in the second figure, there are twelve distinct chords whereas in your figure there appears to be twelve sets of chords where each set may contain duplicated ones. What happens if you try to plot the unique chords as
stem(unique(gk));
How does your figure look then?
Answers (0)
See Also
Categories
Find more on Audio I/O and Waveform 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!