Thread Subject: How to plot the frequency of wav file only upto 7 Kilo Hertz

Subject: How to plot the frequency of wav file only upto 7 Kilo Hertz

From: Munaza

Date: 1 Feb, 2012 18:35:10

Message: 1 of 3

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..

Subject: How to plot the frequency of wav file only upto 7 Kilo Hertz

From: Lothar Schmidt

Date: 2 Feb, 2012 10:01:26

Message: 2 of 3

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)

Subject: How to plot the frequency of wav file only upto 7 Kilo Hertz

From: Munaza

Date: 3 Feb, 2012 19:57:12

Message: 3 of 3

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

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread

Contact us at files@mathworks.com