for resampling to 33 kHz another cutoff frequency is required otherwise we get aliasing

This commit is contained in:
Volker Fischer 2009-07-08 17:37:20 +00:00
parent 391ef9f525
commit 85b7c09476
2 changed files with 69 additions and 69 deletions

View file

@ -31,70 +31,70 @@ static float fResTaps2[INTERP_I_2 * DECIM_D_2 * NUM_TAPS_PER_PHASE2] = {
// Filter for ratio 16 / 11
static float fResTaps16_11[INTERP_I_16_11 * DECIM_D_16_11 * NUM_TAPS_PER_PHASE16_11] = {
-0.00166153593782404040f,
-0.00400364450002697190f,
-0.00754180943600598310f,
-0.01236981084611786900f,
-0.01846594548390187400f,
-0.02566144316480852400f,
-0.03361497106778517400f,
-0.04179645113797186100f,
-0.04948305818528178600f,
-0.05576961813435068300f,
-0.05959471599149660000f,
-0.05978270597815973900f,
-0.05510056913534409900f,
-0.04432728105482986600f,
-0.02633213884793594200f,
-0.00015745813567038185f,
0.03489971383238001100f,
0.07921263209216204700f,
0.13276239482902960000f,
0.19509330908460285000f,
0.26529052675438441000f,
0.34198313736664138000f,
0.42337433602310359000f,
0.50729851336434328000f,
0.59130326595318916000f,
0.67275253751964137000f,
0.74894551163938716000f,
0.81724461102805557000f,
0.87520512237856352000f,
0.92069863244031824000f,
0.95202266733675822000f,
0.96798966841785694000f,
0.96798966841785694000f,
0.95202266733675822000f,
0.92069863244031824000f,
0.87520512237856352000f,
0.81724461102805557000f,
0.74894551163938716000f,
0.67275253751964137000f,
0.59130326595318916000f,
0.50729851336434328000f,
0.42337433602310359000f,
0.34198313736664138000f,
0.26529052675438441000f,
0.19509330908460285000f,
0.13276239482902960000f,
0.07921263209216204700f,
0.03489971383238001100f,
-0.00015745813567038185f,
-0.02633213884793594200f,
-0.04432728105482986600f,
-0.05510056913534409900f,
-0.05978270597815973900f,
-0.05959471599149660000f,
-0.05576961813435068300f,
-0.04948305818528178600f,
-0.04179645113797186100f,
-0.03361497106778517400f,
-0.02566144316480852400f,
-0.01846594548390187400f,
-0.01236981084611786900f,
-0.00754180943600598310f,
-0.00400364450002697190f,
-0.00166153593782404040f
-0.00389889725874395950f,
-0.00683214543790156090f,
-0.01072680249202097000f,
-0.01553896779709462000f,
-0.02111182416262372800f,
-0.02715802026999649900f,
-0.03324873986594503000f,
-0.03881136024854929500f,
-0.04313717468451081600f,
-0.04540006283235589100f,
-0.04468627284754060600f,
-0.04003467459491787100f,
-0.03048601148793385700f,
-0.01513888135261078900f,
0.00679052165107026960f,
0.03590841121927474500f,
0.07258699462937284700f,
0.11691555417711026000f,
0.16866274617280169000f,
0.22725337385053512000f,
0.29176217038299262000f,
0.36092619189350539000f,
0.43317632432273434000f,
0.50668722287057033000f,
0.57944380845094834000f,
0.64932132566729828000f,
0.71417500205550644000f,
0.77193461070469982000f,
0.82069878531213381000f,
0.85882380658614410000f,
0.88500178763806503000f,
0.89832372561302798000f,
0.89832372561302798000f,
0.88500178763806503000f,
0.85882380658614410000f,
0.82069878531213381000f,
0.77193461070469982000f,
0.71417500205550644000f,
0.64932132566729828000f,
0.57944380845094834000f,
0.50668722287057033000f,
0.43317632432273434000f,
0.36092619189350539000f,
0.29176217038299262000f,
0.22725337385053512000f,
0.16866274617280169000f,
0.11691555417711026000f,
0.07258699462937284700f,
0.03590841121927474500f,
0.00679052165107026960f,
-0.01513888135261078900f,
-0.03048601148793385700f,
-0.04003467459491787100f,
-0.04468627284754060600f,
-0.04540006283235589100f,
-0.04313717468451081600f,
-0.03881136024854929500f,
-0.03324873986594503000f,
-0.02715802026999649900f,
-0.02111182416262372800f,
-0.01553896779709462000f,
-0.01072680249202097000f,
-0.00683214543790156090f,
-0.00389889725874395950f
};
// Filter for ratios close to 1

View file

@ -22,7 +22,7 @@ I2 = 2;
D2 = 1;
% filter design
h2 = DesignFilter(NoTapsP2, I2);
h2 = DesignFilter(NoTapsP2, I2, 0.97);
% Filter for ratio 16 / 11 -----------------------------------------------------
@ -31,7 +31,7 @@ I16_11 = 16;
D16_11 = 11;
% filter design
h16_11 = DesignFilter(NoTapsP16_11, I16_11);
h16_11 = DesignFilter(NoTapsP16_11, I16_11, 0.90);
% Filter for ratios close to 1 -------------------------------------------------
@ -39,7 +39,7 @@ h16_11 = DesignFilter(NoTapsP16_11, I16_11);
I1 = 10; % D = I in this mode
% MMSE filter-design and windowing
h1 = DesignFilter(NoTapsP1, I1);
h1 = DesignFilter(NoTapsP1, I1, 0.97);
% Export coefficiants to file ****************************************
@ -94,13 +94,13 @@ fclose(fid);
return;
function h = DesignFilter(NoTapsPIn, I)
function h = DesignFilter(NoTapsPIn, I, cutofffactor)
% number of taps, consider interpolation factor
NoTapsP = NoTapsPIn * I;
% Cut-off frequency (normlized)
fc = 0.97 / I;
fc = cutofffactor / I;
% MMSE filter design with Kaiser window, consider interpolation factor
h = I * firls(NoTapsP - 1, [0 fc fc 1], [1 1 0 0]) .* kaiser(NoTapsP, 5)';