Proyecto 04
Proyecto 04
Proyecto 04
Exercise 2: DFT
1. Take a look at the phase of the first fft generated in the section above
(fft(x1,1024)) with plot(arg(fft(x1(1:1024))). The phases will be distributed
randomly between -π and π. Explain why this doesn't affect the signal (hint:
take a look at the magnitudes)
2. Make another plot of the phases but this time only taking into account bins
with a magnitude higher than 0.0001
3. Make a FFT of the signal x1 with a different phase offset (start the FFT at
sample 5 of the vector x1 instead of sample 0). Display the phase of this FFT.
4. Describe the phase relation between the negative and the positive frequency
bins.
5. Display the amplitude and the phases of signal x2 using subplot(2,1,1). The
first plot should show the amplitude and the second one the phase.
1. Generate a sinusoid with a frequency of 440 Hz, amplitude of 0.5 (half the
maximum) and sampling rate of 44100 Hz. Compute its STFT with
parameters of your choice: window-type, window-size, FFT-size, hop-size.
Find the frequency and magnitude of the sinusoidal peak (without
interpolation). What is the error? Now use parabolic interpolation to measure
the frequency and amplitude of the sinusoidal peak. What is the error now?
Explain the results.
2. Generate two sinusoids of frequencies 440Hz and 550Hz, and sampling rate
44100 Hz. Compute its STFT with a Blackman-Harris 74dB window and a
window-size of 512 samples. Find the frequency and magnitude of the
sinusoidal peaks using spectral interpolation. Describe the interference effect
of one sinusoid into the other.
3. Implement the time-domain sinusoidal subtraction method proposed by
McAulay and Quatieri using matlab/octave.
4. Generate a 0.5 seconds sinusoid with an exponentially increasing frequency,
starting at 440Hz and ending at 880 Hz. Measure the sinusoidal peak in two
consecutive frames from the middle of the sound. Subtract the sinusoid using
the algorithm implemented in the previous exercise. Measure the magnitude
of the residual signal. Find the best analysis parameters to minimize the
magnitude of the residual. Explain the results.
1. Use the data produced by sms to draw a plot that shows the significant
feature(s) of the sound.
2. Change the analysis parameters of the sms.m program
1. Change the window-size and hop-size to values like: w1Length =
1028; n1 = 128; w1Length = 2048; n1 = 512;
2. Keeping all parameters above the same, change the number of
sinusoids to n=2, 5, 100
3. Describe the effect of these changes.
3. Analyze AfluteNaFr-C5.wav sound using the sms.m program
1. Listen to the sound. Perform an analysis of this file with the above given
parameters.
2. Change the parameters to get less artifacts in the resynthesis.
3. Describe the main characteristics of the sound.
4. Plot analysis data that display the characteristics of the sound.
Exercise 7: Transformations
The sms.m program can be extended by adding transformations. In the sms.m file
locate the line "Transformations". This is the place where the sinusoidal plus residual
data can be transformed before a sound is synthesized. The variable iloc holds an
array of peak positions, whereas the variable ival holds the corresponding amplitude
values. We can use these two arrays in order to fill syniloc and synival, the
corresponding arrays that get synthesized.
We can implement a band-pass filter defined by (x, y) points where x is the frequency
value in Hertz and y is the amplitude factor to apply. In the example code given
below, we define a band pass filter which suppresses frequencies not included in
the range [2100 3000]
3. Frequency Scaling
Mode 4 is frequency stretch, where the fundamental stays the same but the sound
gets inharmonic.
Finally mode 5 is frequency scaling, where the pitch of the sound is changed, while
the duration stays the same.
4. Transformation plots
Add the function transform to the sms.m file and make a plot of the magnitude values
of a significant frame of DAFx_outresynth, the resynthesized sound, and the same
frame of DAFx_in, the input sound sax.wav. (In one plot, you can use the "hold on"
function). Make one plot for each of the five modes.