Implement a reverbration effect on an audio

조회 수: 1 (최근 30일)
Mahabba Almheiri
Mahabba Almheiri 2020년 4월 29일
댓글: Walter Roberson 2020년 4월 29일
I faced diffiulties in implentenig revrerbartion with the feedback filter y[?] = ?[? − ?] + ?[?], where D is related to the dimensions of the simulated room, and
0 < ? < 1 is the absorption coefficient of the wallsusing tho and audio using this eqution. so whats it the mistake and how the code should be
x=audioread("SpeechDFT-16-8-mono-5secs.wav")
sound(x)
y=zeros(1,length x)
for
n=10
a=1
d=0.500
y(n)=a*y(n-d)+x(n)
end

답변 (1개)

Walter Roberson
Walter Roberson 2020년 4월 29일
In MATLAB, for loops must have one of these syntaxes:
for variable = start : stop
for variable = start : increment : stop
for variable = expression
Using plain for without something that looks like an assignment on the same line, is not valid syntax.
y=zeros(1,length x)
You need to use the function form of length
y=zeros(1,length(x));
  댓글 수: 4
Mrutyunjaya Hiremath
Mrutyunjaya Hiremath 2020년 4월 29일
편집: Mrutyunjaya Hiremath 2020년 4월 29일
y(n) =a*y(n-d)+x(n)
d = 0.5
but array index (n-d) must be integer.
Walter Roberson
Walter Roberson 2020년 4월 29일
y(n-d) does not appear anywhere in your posted equation, y[?] = ?[? − ?] + ?[?]
Perhaps it should have been . If so then take note that the [] are not indices and instead represent functional relationship. The value at time n depends upon the value at time n - D. D is time, not relative index. When you convert your equation over to using vectors, you need to convert that D from being time to being relative index, by multiplying the time by the sample rate.
Often when time is converted to delay in samples, the result is not an integer. You can choose to ignore that, using floor() or ceil() or round() of the delay-in-samples; this will result in the signal not really being right, especially if it has to pass through more processing. For example, two stages of delays of 22.5 samples should logically be the same as a single delay of 45 samples, not of 2*floor(22.5) = 44 or 2*ceil(22.5) = 26. The higher your sample rate, the less significant the difference will be for perception. But to get it right, you might choose to use fractional delay techniques.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by