필터 지우기
필터 지우기

Time shifting(adding silence in beginning) in audio signals

조회 수: 7 (최근 30일)
adnan abid
adnan abid 2021년 1월 8일
댓글: Cris LaPierre 2022년 1월 21일
I am new to matlab and i want to know how to shift audio files in matlab. For example if a audio file is of 30 second how should i add a silent audio in the beginning. I want the user to add a number and add that much silence to the audio in the beginning. for example if user enters 8 the resulting audio will be of 38 seconds with first 8 seconds as silence

답변 (1개)

Cris LaPierre
Cris LaPierre 2021년 1월 8일
After importing your audio signal, you could pad the beginning of the signal with zeros. Use the sample frequency to determine how many you need to add to give the desired amount of silence.
  댓글 수: 3
Ivana Tanasic
Ivana Tanasic 2022년 1월 21일
To clarify, I have one signal that is of the size 78001 x 2 and another of 228000 x 2 and I want to make them the same length by padding the first with 0s before it starts (I have only been able to add zeros to the end of it sofar)
Cris LaPierre
Cris LaPierre 2022년 1월 21일
There is no one way to do it.
You could use concatenation
A = rand(3,2);
B = [zeros(4,2); A]
B = 7×2
0 0 0 0 0 0 0 0 0.0017 0.0219 0.3374 0.6319 0.3173 0.2995
or perhaps padarray.
C = padarray(A,4,0,'pre')
C = 7×2
0 0 0 0 0 0 0 0 0.0017 0.0219 0.3374 0.6319 0.3173 0.2995

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

카테고리

Help CenterFile Exchange에서 Audio Processing Algorithm Design에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by