Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Institute of Technical Acoustics (ITA)
ITADSP
Commits
efed9f77
Commit
efed9f77
authored
Jun 21, 2017
by
Dipl.-Ing. Jonas Stienen
Browse files
Fixing zero mag filtering, is now zero.
parent
91fa4f09
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/ITAThirdOctaveFilterbankIIR.cpp
View file @
efed9f77
...
...
@@ -80,7 +80,7 @@ void CITAThirdOctaveFilterbankIIR::Process( const float* pfInputSamples, float*
for
(
int
j
=
1
;
j
<
iLastBandIndex
;
j
++
)
m_vBiquads
[
i
*
m_nBiquadsPerBand
+
j
].
Process
(
m_sfTempFilterBuf
.
GetData
(),
m_sfTempFilterBuf
.
GetData
(),
m_iBlockLength
);
const
float
fGain
=
float
(
db10_to_ratio
(
oLatestMagnitudeUpdate
.
oMags
[
i
]
)
)
;
const
float
fGain
=
oLatestMagnitudeUpdate
.
oMags
[
i
];
const
int
iOutputWriteMode
=
(
i
==
0
?
CITABiquad
::
OUTPUT_OVERWRITE
:
CITABiquad
::
OUTPUT_ADD
);
m_vBiquads
[
i
*
m_nBiquadsPerBand
+
iLastBandIndex
].
Process
(
m_sfTempFilterBuf
.
GetData
(),
m_pfTempOutputBuf
.
GetData
(),
m_iBlockLength
,
fGain
,
iOutputWriteMode
);
}
...
...
@@ -99,7 +99,7 @@ void CITAThirdOctaveFilterbankIIR::Process( const float* pfInputSamples, float*
// Letztes Biquad mit Gain: tmp => output
const
float
fGain1
=
m_oMagnitudesInternal
[
i
];
const
float
fGain2
=
float
(
db10_to_ratio
(
oLatestMagnitudeUpdate
.
oMags
[
i
]
)
)
;
const
float
fGain2
=
oLatestMagnitudeUpdate
.
oMags
[
i
];
m_vBiquads
[
i
*
m_nBiquadsPerBand
+
iLastBandIndex
].
Process
(
m_sfTempFilterBuf
.
GetData
(),
m_pfTempOutputBuf
.
GetData
(),
m_iBlockLength
,
fGain1
,
fGain2
,
(
i
==
0
?
CITABiquad
::
OUTPUT_OVERWRITE
:
CITABiquad
::
OUTPUT_ADD
)
);
}
}
...
...
tests/ITADSPThirdOctaveFilterbankTest.cpp
View file @
efed9f77
...
...
@@ -49,7 +49,7 @@ void TestThirdOctaveFilterbankIIR()
pIIRFilterbank
->
Clear
();
oMags
.
SetZero
();
pIIRFilterbank
->
SetMagnitudes
(
oMags
);
pIIRFilterbank
->
SetMagnitudes
(
oMags
,
false
);
sw
.
start
();
pIIRFilterbank
->
Process
(
x
.
GetData
(),
y
.
GetData
()
);
...
...
tests/ITADSPThirdOctaveFilterbankTest.m
View file @
efed9f77
...
...
@@ -4,7 +4,7 @@
% Requires ITA Toolbox, see http://ita-toolbox.org
iir_ident
=
ita_read
(
'ITADSPThirdOctaveFilterbankTest_IIR_Identity.wav'
);
iir_ident
.
signalType
=
'energy'
;
%
iir_ident.signalType = 'energy';
iir_ident
.
channelNames
=
{
'Identity'
};
iir_ident
.
pf
...
...
@@ -12,6 +12,11 @@ test_iir_ident = ita_normalize_dat( ita_merge( ita_demosound, ita_convolve( ita_
test_iir_ident2
=
ita_normalize_spk
(
ita_merge
(
ita_demosound
,
ita_convolve
(
ita_demosound
,
iir_ident
)
),
'allchannels'
,
true
);
test_iir_ident2
.
play
iir_zeros
=
ita_read
(
'ITADSPThirdOctaveFilterbankTest_IIR_Zeros.wav'
);
iir_zeros
.
channelNames
=
{
'Zeros'
};
iir_zeros
.
pf
fdatool
SOS
=
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment