This is where navigation should be.

AUDFILTERS - Generates filters equidistantly spaced on auditory frequency scales

Usage

[g,a,fc,L]=audfilters(fs,Ls);
[g,a,fc,L]=audfilters(fs,Ls,...);

Input parameters

fs Sampling rate (in Hz).
Ls Signal length.

Output parameters

g Cell array of filters.
a Downsampling rate for each channel.
fc Center frequency of each channel.
L Next admissible length suitable for the generated filters.

Description

[g,a,fc,L]=audfilters(fs,Ls) constructs a set of filters g that are equidistantly spaced on a perceptual frequency scale (see freqtoaud) between 0 and the Nyquist frequency. The filter bandwidths are proportional to the critical bandwidth of the auditory filters audfiltbw. The filters are intended to work with signals with a sampling rate of fs. The signal length Ls is mandatory, since we need to avoid too narrow frequency windows.

By default the ERB scale is chosen but other frequency scales are possible. Currently supported scales are 'erb', 'erb83', 'bark', 'mel' and 'mel1000', and can be changed by passing the associated string as an optional parameter. See freqtoaud for more information on the supported frequency scales.

By default, a Hann window shape is chosen as prototype frequency response for all filters. The prototype frequency response can be changed by passing any of the window types from firwin or freqwin as an optional parameter.

[g,a,fc,L]=audfilters(fs,Ls,fmin,fmax) constructs a set of filters between fmin and fmax. The filters are equidistantly spaced on the selected frequency scale. One additional filter will be positioned at the 0 and Nyquist frequencies each, so as to cover the full range of positive frequencies. The values of fmin and fmax can be instead specified using a key/value pair as:

[g,a,fc,L]=audfilters(fs,Ls,...,'fmin',fmin,'fmax',fmax)

Default values are fmin=0 and fmax=fs/2.

For more details on the construction of the filters, please see the given references.

Downsampling factors

The integer downsampling rates of the channels must all divide the signal length, filterbank will only work for input signal lengths being multiples of the least common multiple of the downsampling rates. See the help of filterbanklength. The fractional downsampling rates restrict the filterbank to a single length L=Ls.

[g,a]=audfilters(...,'regsampling') constructs a non-uniform filterbank with integer subsampling factors.

[g,a]=audfilters(...,'uniform') constructs a uniform filterbank where the integer downsampling rate is the same for all the channels. This results in most redundant representation which produces nice plots.

[g,a]=audfilters(...,'fractional') constructs a filterbank with fractional downsampling rates a. This results in the least redundant system.

[g,a]=audfilters(...,'fractionaluniform') constructs a filterbank with fractional downsampling rates a, which are uniform for all filters except the "filling" low-pass and high-pass filters which can have different fractional downsampling rates. This is useful when uniform subsampling and low redundancy at the same time are desirable.

Additional parameters

audfilters accepts the following optional parameters:

'spacing',b Specify the spacing between the filters, measured in scale units. Default value is b=1 for the scales 'erb', 'erb83' and 'bark'; the default is b=100 for 'mel' and 'mel1000'.
'bwmul',bwmul Bandwidth of the filters relative to the bandwidth returned by audfiltbw. Default value is bwmul=1 for the scales 'erb', 'erb83' and 'bark'; the default is b=100 for 'mel' and 'mel1000'.
'redmul',redmul Redundancy multiplier. Increasing the value of this will make the system more redundant by lowering the channel downsampling rates. It is only used if the filterbank is a non-uniform filterbank. Default value is 1. If the value is less than one, the system may no longer be painless.
'redtar',redtar Target redundancy. The downsampling factors will be adjusted to achieve a redundancy as close as possible to 'redtar'.
'M',M Specify the total number of filters between fmin and fmax. If this parameter is specified, it overwrites the 'spacing' parameter.
'symmetric' Create filters that are symmetric around their centre frequency. This is the default.
'warped' Create asymmetric filters that are symmetric on the auditory scale.
'complex' Construct a filterbank that covers the entire frequency range instead of just the positive frequencies this allows the analysis of complex valued signals.
'nosubprec' Disable subsample window positions.
'trunc_at' When using a prototype defined in freqwin, a hard thresholding of the filters at the specified threshold value is performed to reduce their support size. The default value is trunc_at=10e-5. When no truncation is desired, trunc_at=0 should be chosen. This value is ignored when a prototype shape from firwin was chosen.
'min_win',min_win Minimum admissible window length (in samples). Default is 4. This restrict the windows not to become too narrow when L is low.

Examples:

In the first example, we construct a highly redudant uniform filterbank on the ERB scale and visualize the result:

[f,fs]=greasy;  % Get the test signal
[g,a,fc,L]=audfilters(fs,length(f),'uniform','M',100);
c=filterbank(f,g,a);
plotfilterbank(c,a,fc,fs,90,'audtick');
audfilters_1_1.png

In the second example, we construct a non-uniform filterbank with fractional sampling that works for this particular signal length, and test the reconstruction. The plot displays the response of the filterbank to verify that the filters are well-behaved both on a normal and an ERB-scale. The second plot shows frequency responses of filters used for analysis (top) and synthesis (bottom).

[f,fs]=greasy;  % Get the test signal
L=length(f);
[g,a,fc]=audfilters(fs,L,'fractional');
c=filterbank(f,{'realdual',g},a);
r=2*real(ifilterbank(c,g,a));
norm(f-r)

% Plot the response
figure(1);
subplot(2,1,1);
R=filterbankresponse(g,a,L,fs,'real','plot');

subplot(2,1,2);
semiaudplot(linspace(0,fs/2,L/2+1),R(1:L/2+1));
ylabel('Magnitude');

% Plot frequency responses of individual filters
gd=filterbankrealdual(g,a,L);
figure(2);
subplot(2,1,1);
filterbankfreqz(gd,a,L,fs,'plot','linabs','posfreq');

subplot(2,1,2);
filterbankfreqz(g,a,L,fs,'plot','linabs','posfreq');

This code produces the following output:

ans =

   7.4235e-15
audfilters_2_1.png audfilters_2_2.png

References:

T. Necciari, P. Balazs, N. Holighaus, and P. L. Søndergaard. The ERBlet transform: An auditory-based time-frequency representation with perfect reconstruction. In Proceedings of the 38th International Conference on Acoustics, Speech, and Signal Processing (ICASSP 2013), pages 498--502, Vancouver, Canada, May 2013. IEEE.

T. Necciari, N. Holighaus, P. Balazs, Z. Průša, P. Majdak, and O. Derrien. Audlet filter banks: A versatile analysis/synthesis framework using auditory frequency scales. Applied Sciences, 8(1), 2018. [ DOI | http ]