Filter specific frequencies in an audio file

80 views (last 30 days)
Hello,
First time asking a question on here as I have hit that brick wall now.
I am trying to filer an audio signal that I have, for example I only want to know between 100 and 1000 Hz, instead of the whole thing. I can try a limit of the axis, but of course the data is still there when I further process it.
I have read through many, many, many examples on here and can't seem to figure it out at all. I have looked at bandpass filtering, something to do with butter....
My code uses a FFT to look at the full frequency spectrum, with the audio clip available at http://bit.ly/2RlPl6p . This is just the FFT, I haven't included any filering bits.
File = 'Loud.wav';
[x,fs] = audioread(File);
lpad = 8*length(x);
xdft = fft(x,lpad);
xdft = xdft(1:lpad/2+1);
xdft = xdft/length(x);
xdft(2:end-1) = 2*xdft(2:end-1);
freq = 0:fs/lpad:fs/2;
plot(freq,(abs(xdft)));
hold on
xlabel('Hz')
xlim([0,16000])
ylim([0,3e-3])
ylabel('Amplitude')
hold off
Any help at all would be greatly appreciatied!
(I am not a student doing homework)
P.s.
This is the wav file stats.
SampleRate: 48000
TotalSamples: 513984
Duration: 10.7080
Title: []
Comment: []
Artist: []
BitRate: 63.1170

Accepted Answer

Star Strider
Star Strider on 12 Jan 2019
If you have R2018a or later, use the bandpass (link) function.
If you want to filter it in the frequency domain, see the documentation for the fftfilt (link) function.
  14 Comments
Kavy Jain
Kavy Jain on 7 Sep 2020
can somebody plz help me how to extract a given audio signal from set of audio signals

Sign in to comment.

More Answers (0)

Categories

Find more on Audio I/O and Waveform Generation in Help Center and File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!