How to decrease total samples of audio?
조회 수: 6 (최근 30일)
이전 댓글 표시
Hello,
I want to decrease total samples of my audio. My SampleRate: 10000 and total samples is 329000 but I want decrease to 44100. I try that downsample method but ı cant succesful. after that ı try to audiowrite(newfile, y, fs2); like this way audiowrite('myaudio.wav',44100,10000) but I got the this error message;
Warning: Data clipped when writing file.
> In audiowrite>clipInputData (line 407)
In audiowrite (line 187)
I would be grateful if someone help me.
댓글 수: 2
Geoff Hayes
2020년 4월 14일
편집: Geoff Hayes
2020년 4월 14일
Nasuhcan - from your comment SampleRate: 10000 but I want decrease to 44100, are you really trying to reduce the total number of samples, or are you changing the sampling rate? Why 44100? If you are reducing the number of samples from 329000 to 44100 (~13.4% reduction), will you keep the same sampling rate of 10000?
답변 (1개)
Walter Roberson
2020년 4월 14일
audiowrite does not resample. The data you pass as the second parameter to it is the samples, so you are passing a single sample with value 44100. Notice how you did not pass your signal y to audiowrite. And NO, you cannot audiowrite a signal and then call audiowrite again with the same file name with the intention that audiowrite would somehow know that your intention was for it to read the file and resample it and write it back.
You should be using resample() to create a modified signal that you audiowrite
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Multirate Signal Processing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!