필터 지우기
필터 지우기

data clipped warning while coding.

조회 수: 3 (최근 30일)
maulik bhagat
maulik bhagat 2022년 9월 3일
댓글: maulik bhagat 2022년 9월 15일
i am trying to run the code but error is popping up that data clipped when writing file
code:
load handel.mat
t=-4:1/22100:4;
f=40000;
fs=20000;
y1=sin(2*pi*f*t);
y2=sin(2*pi*fs*t);
y=y1+y2;
samples = [1,5*Fs];% for 5 second
filename = 'handel.wav';
audiowrite(filename,y,fs);
[y,Fs] = audioread('handel.wav',samples);
sound(y,Fs);

답변 (1개)

Mathieu NOE
Mathieu NOE 2022년 9월 5일
hello
FYI, wav export will clip data exceeding +/- 1 range
so you have to normalize the data (y) before writting to wav format
y=y1+y2;
y = y./max(abs(y));
  댓글 수: 2
Mathieu NOE
Mathieu NOE 2022년 9월 12일
hello again
problem solved ?
maulik bhagat
maulik bhagat 2022년 9월 15일
solved thank you.

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

카테고리

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

태그

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by