Is Discrete Wavelet Transform error or Audio Write error for data clipping?

18 次查看(过去 30 天)
I'm studying the scrambling method using DWT domain. Now, I'm facing 'data clip' problem when writing the audio. I tested 2 ways to know what the error is.
Firstly, read the audio, decompose the audio using DWT and reconstruct the audio without doing anything and then write the audio. At that time, I found data clip error in some songs. Maximum double value of the audio is '+1'. So, I thought this is because of that "+1", I learned that the valid range of the data have to be -1.0 ≤ y ≤ +1.0 in audio write. But, the sample value of the original audio and saved audio after reconstruction is same, so I assmued there's no data loss.
Secondly, read the same audio then write that audio without doing anything. At that time, no data clip error is occur. I check the maximum double value of that audio is '+1' but audio write function can work successfully without data clipping. Also, the sample value of the original audio and saved audio is same.
So, I have no idea that data clip error is because of DWT or Audio Write. Please kindly give me an answer for this matter, thanks.
audio1=audioread('S1.wav');
>> [c,l]=wavedec(audio1,4,'db1');
>> reconstruct=waverec(c,l,'db1');
>> max(audio1)
ans =
1.0000
>> max(reconstruct)
ans =
1.0000
>> audiowrite('reconstruct.wav',reconstruct,44100);
Warning: Data clipped when writing file.
> In audiowrite>clipInputData (line 396)
In audiowrite (line 176)
>> audio2=audioread('S1.wav');
>> max(audio2)
ans =
1.0000
>> audiowrite('audio.wav',audio2,44100);
  2 个评论
Walter Roberson
Walter Roberson 2019-2-19
what shows up for
max(reconstruct)-1
I suspect some values become 1 within roundoff error but slightly greater than 1
SuLatt Sandi
SuLatt Sandi 2019-2-20
Yes Sir, my research is to control audio quality using scrambling method in DWT Domain. The problem is if I made scrambling the audio without using audio write and then make descrambling that audio, at that time descrambling process is successful and I got original quality of the audio. But, if I write audio after scrambling and then make descrambling that saved audio, at that time I can't get original quality and still get scrambling quality. That's why I confuse, is it the error of DWT or audio write.

请先登录,再进行评论。

回答(0 个)

类别

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