필터 지우기
필터 지우기

How do I amplify my sound using soundsc?

조회 수: 16 (최근 30일)
Sergio Campos
Sergio Campos 2016년 12월 7일
댓글: Walter Roberson 2018년 12월 24일
I want to amplify the sound I produced using soundsc by raising the sound by a steady increase of dB. I am trying to make a hearing test so I need to increase the dB if the user cannot hear. Code:
fs = 8000; %sampling rate
dur = 3;
tt = 0 : 1/fs : dur; %time duration
f=1000; %frequency
vol= db2mag(1);
y=vol*sin(2*pi*f*tt);
soundsc( y, fs );
Where do I apply the dB? When I multiply it to the signal I do not notice a change. Say i increase it from 1 dB to 10, I still do not hear the difference. Another issue, at certain frequencies my sound sounds extremely distorted such as at 20kHz and 30kHz. Why is this? And at certain higher frequencies my sound sounds like it is a lower frequency. For example, at 29kHz it sounds higher than 31kHz. I am fairly new to Matlab so help would be appreciated.

채택된 답변

Jan
Jan 2016년 12월 7일
편집: Jan 2016년 12월 7일
soundsc scale the sound already until the amplitude reachs 1.0 . Try sound instead or audioplayer.
If you have a sampling frequency fs of 8kHz, you cannot create a signal with 29 or 31 kHz. Only frequencies upto half of the sampling rate can be represented. Otherwise the signal has several periods between two time steps. You can see this, by plotting a signal with 7999Hz and 8001Hz. Look in the net for "Nyquist"
  댓글 수: 4
keshav poojari
keshav poojari 2018년 12월 24일
Sir.. Can i amplify Prerecorded audio in R2013a release?
Walter Roberson
Walter Roberson 2018년 12월 24일
Can i amplify Prerecorded audio in R2013a release
Yes.
amp = 4/3; %turn it up loudER
filename_in = 'never_going.wav';
filename_out = 'give_you_up.wav';
[data, fs] = audioread(filename_in);
new_data = data*amp;
new_data = max( min(new_data, 1), -1 ); %clip when it gets too loud
audiowrite(filename_out, new_data, fs);

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Audio and Video Data에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by