|
Lothar Schmidt <vapooroop@gmx.net> wrote in message <jgdmto$rg5$1@news.albasani.net>...
> Am 01.02.2012 19:35, schrieb Munaza:
> > Hi i am new to working with sound files in Matlab. I want to plot the
> > frequency of wav file . so that frequency plot is upto 7KHZ only . e.g
> > if wav file has frequency plot upto 15000Hz than i want to plot it only
> > upto 7KHz and filter the above part. i don't have any idea about its
> > code.. please help me..
>
> if you want to remove the high frequent components from the signal:
> man filter
>
> if you want to show only the interesting part
> man axes
>
> if you want to plot only the interesting part
> interesting=find(f>fmin & f<fmax);
> f_new=f(interesting)
> p_new=p(interesting)
> plot(fnew,pnew)
thanks Lothar Schmidt, i can't understand ur answer. i have got the frequency plot by the following Matlab Code
[wave,fs]=wavread('triangle.wav'); % read file into memory */
sound(wave,fs); % see what it sounds like */
t=0:1/fs:(length(wave)-1)/fs; % and get sampling frequency */
plot(t,wave);
figure(1);
plot(t,wave);
title('Wave File');
ylabel('Amplitude');
xlabel('Length (in seconds)');
% graph it – try zooming while its up…not much visible until you do*/
n=length(wave)-1;
f=0:fs/n:fs;
wavefft=abs(fft(wave)); % perform Fourier Transform *
figure(2);
plot(f,wavefft); % plot Fourier Transform */
xlabel('Frequency in Hz');
ylabel('Magnitude');
title('The Wave FFT');
Now i want to plot the wav file frequency upto 7KHz only and the rest part to filter out, so that only upto 7KHz wav file is passed out as an output. please tell me that what will be the code for it.
Munaza
|