Is there any changes after writing audio in MatLab?

조회 수: 1 (최근 30일)
Su Latt Sandi
Su Latt Sandi 2018년 9월 10일
답변: Jan 2018년 9월 10일
Hello,
I'm UCSY student in Myanmar. Now, I research about Progressive Audio Scrambling based on DWT Domain. My program process is..
Scrambling Process: 1. Read Audio 2. Decompose wavelet coefficients by using DWT 3. Scramble with audio coefficients and key 4. Reconstruct scrambled audio coefficients 5. Write Audio
Descrambling Process: 1.Read scrambled audio 2. Decompose scrambled audio 3. Descramble with audio coefficients & keys 4. Reconstruct descrambled audio 5. Audio write
The problem is I can't get back original audio while descrambling after writing scrambled audio (saved audio). But, I can get back original quality if I didn't write scrambled audio. Even I used same key in descrambling process. Now, I have no idea what's the solution for it :(
Please someone give me suggestion for the above problem.

답변 (1개)

Jan
Jan 2018년 9월 10일
In other words:
S1 = Scrambling('demo.wav', 3, 5, 'dbl');
D1 = Descrambling(S1, 3, 5, 'dbl');
file = fullfile(tempdir, 'test.wav');
audiowrite(file, S1, 44100);
S2 = audioread(file);
D2 = Descrambling(S2, 3, 5, 'dbl');
Now you find out, that D1 does not equal D2, correct? So what are the differences? "I can't get back original audio" does not clarify this uniquely.
Nevertheless, a difference of D1 and D2 seems to be caused by a difference of S1 and S2. Remember that audiowrite limits the output of e.g. doubles to the range [-1.0, 1.0]. So maybe you want this instead:
audiowrite(file, uint8(S1), 44100);
But this is a pure guess only.
The expression "5. Write Audio" at scrambling and and "1.Read scrambled audio" at descrambling does not match to your code, where Scrambling replies the signal and does not write a file.

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by