data clipped warning while coding.

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일

0 개 추천

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.

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

카테고리

제품

릴리스

R2022a

태그

질문:

2022년 9월 3일

댓글:

2022년 9월 15일

Community Treasure Hunt

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

Start Hunting!

Translated by