Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

New to MATLAB?

Thread Subject:
Amplifying Specific Audio Frequency in a Wave File

Subject: Amplifying Specific Audio Frequency in a Wave File

From: Syed Zeeshan Ali

Date: 3 Oct, 2013 02:52:06

Message: 1 of 2

Dear Professionals,

Hi there, I am almost a newbie to MATLAB. What I am trying to achieve here is to amplify somewhat the frequencies that lie within the range of 6000 Hz to 7000 Hz in a Wave file. The purpose is to amplify any particular range frequencies, if required by any user, in there sound files.
For this purpose, I am now unsure, how to address only these frequencies and then amplify them somewhat (to any level i mean) and more importantly writing this to the new file which has these amplified frequencies.
For now, here is what I have done:
1) Read a Wave file
2) Did a FFT on it.
3) I have been to able to plot the frequencies with in that vary specific range i.e. 6000 to 7000 for now.
4) But now I am unsure how to address and amplify those particular frequencies.

My experience in other programming languages would suggest me, to run a loop from starting to ending frequency and place an if statement, which shall look for frequency values within that vary range and then keeps on amplifying them. Finally write it to the new file using Wavwrite( ) and then shall take the IFFT( ) of the new file so that it sounds like the original file with only few amplified frequencies. But in MATLAB i am simply unsure how to do it. Please any references and code snippets would be a blessing. If you people can point me towards a book or an article would love to grab it at once or a little coding help would get me going.

Sorry for such a basic question to professionals but I am just getting my feet wet with MATLAB. Thanks for your help and looking forward to hear ASAP from you great people out there.

Subject: Amplifying Specific Audio Frequency in a Wave File

From: Dehuan Xin

Date: 6 Oct, 2013 13:51:10

Message: 2 of 2

you may want to design a filter (firpm) and then filter the waveform

FFT is also OK.
first you must know the sampling frequency of you audio file.
then you FFT it and then FFTSHIFT it.
then you locate the frequency band you want to amplify, and multiply it with a gain.
then ifftshift and then ifft.
it might be non-trivial to locate the frequency band, because there are two of them, as FFT is symmetric.
and it may become for confusing if your data length is even.

so, use filter
try FFT when you fully understand it

Tags for this Thread

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.

Contact us