How to add gain to an audio signal?

조회 수: 46 (최근 30일)
Giggs B.
Giggs B. 2022년 5월 29일
답변: Star Strider 2022년 5월 29일
Hi,
I wanted to ask if there is a way to add gain to an audio signal using MATLAB?
For ex., I have an audio file, and I want to add ~30dB gain to the signal. How can I do that?
Thanks,
Gagan

채택된 답변

Star Strider
Star Strider 2022년 5월 29일
Try this —
Fs = 44100;
t = linspace(0, Fs-1, Fs)/Fs;
s1 = sin(2*pi*t*15);
dB30 = db2mag(30)
dB30 = 31.6228
s2 = s1*dB30;
figure
plot(t, s1, 'DisplayName','Original')
hold on
plot(t, s2, 'DisplayName','Original With 30 dB Amplification')
hold off
grid
legend('Location','best')
.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Audio I/O and Waveform Generation에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by