How do I read and split an audio file into four different frequency ranges?

Technical Source
2 min readMar 9, 2024

--

I have an audio file of sampling frequency as 16 kHz. Now I would like to read it and split its samples into four range. Namely:

0 kHz - 1 kHz
1 kHz - 2 kHz
2 kHz - 4 kHz
4 kHz - 8 kHz

I have come about the following code but I am not sure if it is correct? I wanted to know if there is any other way.

[signal,fs]=audioread('003.wav');
SigFD = (signal);
n = length(signal); % number of samples
deltaF = fs/n; % frequency resolution
F = [0:floor(n/2)-1, -(floor(n/2)):-1]*deltaF; % frequency vector
lowF = 0; % lowF and highF defines one of the range
highF = 1000;
part1Range = abs(F)>lowF&abs(F)<highF;
Fpart1 = F(part1Range);
Sig1FD = SigFD(part1Range);

NOTE:-

Matlabsolutions.com provide latest MatLab Homework Help,MatLab Assignment Help , Finance Assignment Help for students, engineers and researchers in Multiple Branches like ECE, EEE, CSE, Mechanical, Civil with 100% output.Matlab Code for B.E, B.Tech,M.E,M.Tech, Ph.D. Scholars with 100% privacy guaranteed. Get MATLAB projects with source code for your learning and research.

If you have R2018a or later, use the bandpass (link) function on your original signal, each with different passband limits.

If you have an earlier version, use ellipord (link) and ellip (link), that together are almost as easy.

The first filter is a simple lowpass filter with a passband a 1 kHz. You can use this prototype code to design it.

This designs the second filter:

Fs = 1.6E+4;                                                % Sampling Frequency (Hz)
Fn = Fs/2; % Nyquist Frequency (Hz)
Fnotch = 1.5E3; % Notch Frequency (Hz)
BW = 1E+3; % Passband Width (Hz)
Ws = [Fnotch-BW/2-1 Fnotch+BW/2+1]/Fn; % Passband Frequency Vector (Normalised)
Wp = [Fnotch-BW/2-5 Fnotch+BW/2+5]/Fn; % Stopband Frequency Vector (Normalised)
Rp = 1; % Passband Ripple (dB)
Rs = 150;

SEE COMPLETE ANSWER CLICK THE LINK

--

--

Technical Source
Technical Source

Written by Technical Source

Simple! That is me, a simple person. I am passionate about knowledge and reading. That’s why I have decided to write and share a bit of my life and thoughts to.

No responses yet