Is Discrete Wavelet Transform error or Audio Write error for data clipping?
18 views (last 30 days)
Show older comments
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 Comments
Walter Roberson
on 19 Feb 2019
what shows up for
max(reconstruct)-1
I suspect some values become 1 within roundoff error but slightly greater than 1
Answers (0)
See Also
Categories
Find more on Audio Processing Algorithm Design in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!