3.4 Processing the Data and Writing the Result into a wav File 3.4.1 Time revers
ID: 2085446 • Letter: 3
Question
3.4 Processing the Data and Writing the Result into a wav File 3.4.1 Time reversal Following the previous section, you have an array xx that contains some sound. Let's perform some simple processing here. Tasks to complete: First, let's attenuate the signal to half, xh = xx * 0.5; where the new array xh has all the sample values halved from the original signal. Then, we want to reverse the time and write the signal out to a wav file: le length (xh) ; xhr = xh(??:??:??); % figure out how to fill in those ??s audiowrite ('ECE20261ab01out.wa, xhr, fs): Note that the argument fs can be copied from the a udioread result. But you can experiment with your own uch as reducing it to half or doubling it to twice the original value. For instructor verification, show your code with those ??s properly substituted and use soundsc to play the output wav file ECE20261ab01out.wav to the instructor or TA for verification.Explanation / Answer
Mixing the signal by Fs/2 will swap high frequencies and low frequencies - think of rotating the spectrum around the unit circle by half a turn. You can achieve this rotation by multiplying every other sample by -1.
Mixing by Fs/2 is equivalent to mixing by exp(j*pi*n). If x is the input and y the output,
This simplifies easily because sin(pi*n) is 0, and cos(pi*n) is alternating 1,-1.
this can be done in 3 ways:
I tried those 3 ways on my signal:
1) Invert the Q channel
Output:
2) Swap the I and Q channels
Output:
3) Invert the I channel
Output:
Each of these does flip the spectrum of the signal, but it also modifies the spectrum:
1) Inverting Time Domain Q channel also negates/inverts the Frequency Domain Imaginary part.
2) Swapping the I and Q channels also swaps the Frequency Domain Real and Imaginary parts.
3) Inverting the Time Domain I channel also negates/inverts the Frequency domain Real part.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.