Unexpected output of octaveFilter

2 次查看(过去 30 天)
Hey Guys,
I have a problem with the OcataveFilter or do not understand the specific output yet. Maybe you could help me.
So first I create an octaveFilter object.
centerFreq = 800;
bw = '1/3 octave';
Fs = 16000;
octFilt = octaveFilter(centerFreq,bw,'SampleRate',Fs);
My audio data is available as a vector (audio_data). I pass this vector to the system object. Here I keep to the appropriate documentation
filtered_audio_data = octfilt(audio_data);
Now I have presented the data here: I do not understand this behavior. Why is the course between filtered and undfiltered exactly identical ? My expected result is shown at the very bottom. What am I doing wrong in the calculation and what do I have to do to get the expected result ?
Thanks fpr your advice and help
Before Filtering (audio_data):
After Filtering (filtered_audio_data):
Expected Result:

采纳的回答

jibrahim
jibrahim 2022-8-12
Hi Leonard,
The first thing to check is that your input is a column vector. octaveFilter treats each column of data as an independent channel. Second, keep in mind the filter has memory, so there will be transient behavior. If you call the object with a short input, you might be still in the transient region. You need to either call it with more data, or call it more times with more data
  2 个评论
Leonard
Leonard 2022-8-15
thank you very much for your answer. My column vector (audio_data) has 399361 values. Even after trying several times, there seems to be no change at all. However, if I perform the operation in SIMULINK, I get the expected result. This seems to me as not logical, because internally the same operation is performed, isn't it ?
Sound1_3OctaveFilt.slx:
%Start the SIMULINK-Model
out = sim("Sound1_3OctaveFilt.slx");
%Get data from SIMULINK-Model
filtered_audio_data = out.SoundFilt;
jibrahim
jibrahim 2022-8-15
编辑:jibrahim 2022-8-15
Hi Leonard,
Maybe this code helps if you compare with yours. Not sure what's the problem, but this snippet shows the same filter actually modifying a simple test signal:
centerFreq = 800;
bw = '1/3 octave';
Fs = 16000;
octFilt = octaveFilter(centerFreq,bw,'SampleRate',Fs);
octFilt.visualize % see the theoretical response
% Hopefully the filter will attenuate one sine and pass the other one:
osc = audioOscillator(NumTones=2, Frequency=[800 2000],SampleRate=Fs);
scope = timescope(SampleRate=Fs);
for index=1:100
x = osc();
y = octFilt(x);
scope([x,y]) % compare before and after
end

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Measurements and Spatial Audio 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by