help-octave
[Top][All Lists]
Advanced

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

Re: FFT - Spectrum Analyzer


From: Markus Bergholz
Subject: Re: FFT - Spectrum Analyzer
Date: Sun, 10 Jun 2012 22:49:39 +0200

On Sun, Jun 10, 2012 at 5:18 PM, Thomas D. Dean <address@hidden> wrote:
> On 06/09/12 15:27, Renato S. Yamane wrote:
>>
>>
>> Hi,
>>
>> Anyone knows an way to analyze, with Octave, the Spectrum Frequency of a
>> digital media file (like an MP3)?
>> Something like this:
>> http://img268.imageshack.us/img268/6345/bassiloveyou.jpg
>>
>> Thanks and best regards,
>> Renato S. Yamane
>> _______________________________________________
>> Help-octave mailing list
>> address@hidden
>> https://mailman.cae.wisc.edu/listinfo/help-octave
>>
>>
>
> http://labrosa.ee.columbia.edu/matlab/mp3read.html
>

i guess this is not what he want.
he want a frequency analysis.


%Fourier Transform of Sound File

%Load File
file = 'e-neu.wav';
[y,Fs,bits] = wavread(file);

Nsamps = length(y);
t = (1/Fs)*(1:Nsamps);          %Prepare time data for plot

%Do Fourier Transform
y_fft = abs(fft(y));            %Retain Magnitude
y_fft = y_fft(1:Nsamps/2);      %Discard Half of Points
f = Fs*(0:Nsamps/2-1)/Nsamps;   %Prepare freq data for plot

%Plot Sound File in Time Domain
figure
plot(t, y);
xlabel('Time (s)')
ylabel('Amplitude')
title('fft action')

%Plot Sound File in Frequency Domain
figure
plot(f, y_fft);
xlim([0 1000])
xlabel('Frequency (Hz)')
ylabel('Amplitude')
title('Frequency Response of Tuning Fork A4')


but this is not my own code. i've grabbed it somewhere while building
an arduino guitar tuner and played with this code.



> _______________________________________________
> Help-octave mailing list
> address@hidden
> https://mailman.cae.wisc.edu/listinfo/help-octave



-- 
icq: 167498924
XMPP|Jabber: address@hidden


reply via email to

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