Frequency inversion audio scrambling

2 views (last 30 days)
John Lynn
John Lynn on 6 Aug 2015
Commented: Walter Roberson on 8 Aug 2015
Hey everyone. I'm working on a project for my discrete systems class that involves scrambling an audio file (music) and transmitting to another computer to be unscrambled, equalized, and filtered. He specifically mentions using the frequency inversion technique and I'm having a bit of trouble with the output. I've been searching around for several days but haven't been able to find an answer. My code is still a work in progress but the process I'm doing is as follows:
1. read the audio file into matlab
2. normalize the audio data
3. transpose to match the audio array
4. fft
5. multiply with a vector of alternating 1,-1,1,-1,1,-1....
6. real(ifft())
7. normalize
8. play using soundsc()
The problem I'm running into is that the audio that plays is really really quiet, if I hold my speaker right up to the microphone I can unscramble it but I'm supposed to transmit around 5m away and filter noise. Anybody have any ideas as to why this audio is so quiet?

Answers (1)

Walter Roberson
Walter Roberson on 6 Aug 2015
Remember to take into account the complex conjugate symmetry of the points after the first in the fft result; otherwise when you ifft back you are going to get a complex signal.
  2 Comments
John Lynn
John Lynn on 7 Aug 2015
So what does that actually mean in terms of the audio playback? We've never covered any material about this and my professor just took off to speak at a conference almost 3 weeks ago and isn't responding to communication.. Our textbook doesn't seem to have anything helpful either. haha
Walter Roberson
Walter Roberson on 8 Aug 2015
Some of the power could be associated with the complex part of the resulting signal if your altered fft does not come out in the proper form.
Sample multiplication pattern:
A B C D
1, 1 -1 1 -1 1 -1, 1, -1 1 -1 1 -1 1
A: 1.0 so you do not change the first entry
B: alternating pattern of 1 and -1
D: same pattern as B but exactly reversed
C: the original signal length is even then after you take the first entry out of consideration, what remains would be odd length. B and D together would be an even length. C is then needed to leave the value in the middle as-is. But if the original signal length is odd, then after you take the first entry out of consideration, what remains would be an even length, in which case B and D together would exactly cover it, and you would leave out C

Sign in to comment.

Categories

Find more on Fourier Analysis and Filtering in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!