melfilter

generates a mel filter bank for a given frequency vector
4.4K Downloads
Updated 21 Feb 2014

View License

% melfilter Create a mel frequency filterbank
%
% [Filter,MelFrequencyVector] = melfilter(N,FrequencyVector,hWindow)
%
% Generates a filter bank matrix with N lineary spaced filter banks,
% in the Mel frequency domain, that are overlapped by 50%.
%
% `N` the number of filter banks to construct.
%
% `FrequencyVector` a vector indicating the frequencies at which to
% evaluate the filter bank coeffiecents.
%
% `hWindow` a handle to the windowing function that determines the shape
% of the filterbank. The default is hWindow = @triang
%
% `Filter` is sparse matrix of size [N numel(FrequencyVector)].
%
% `MelFrequencyVector` is a vector containing the Mel frequency values
%
% Example
% N = 50;
% Fs = 10000;
% x = sin(2*pi*110*(0:(1/Fs):5));
% [Pxx,F] = periodogram(x,[],512,Fs);
%
% Filter = melfilter(N,F);
% Filter = melfilter(N,F,@rectwin);
% [Filter,MF] = melfilter(N,F,@blackmanharris);
% FPxx = Filter*Pxx;
% plot(1:N,FPxx)
%
% See also
% melfilter melbankm mfcceps hz2mel
%

Cite As

Pierce Brady (2024). melfilter (https://www.mathworks.com/matlabcentral/fileexchange/23179-melfilter), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2007b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories
Find more on Filter Banks in Help Center and MATLAB Answers

Community Treasure Hunt

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

Start Hunting!
Version Published Release Notes
1.2.0.0

Changed the example code

1.1.0.0

Updates
1) A third optional input to allow different window shapes.
2) Mel frequency vector can be returned.
3) Example added to help section

1.0.0.0