Filter specific frequencies in an audio file
80 views (last 30 days)
Show older comments
William Osborne
on 12 Jan 2019
Commented: Kavy Jain
on 7 Sep 2020
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
0 Comments
Accepted Answer
Star Strider
on 12 Jan 2019
14 Comments
Kavy Jain
on 7 Sep 2020
can somebody plz help me how to extract a given audio signal from set of audio signals
More Answers (0)
See Also
Categories
Find more on Audio I/O and Waveform Generation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!