Now that we have created a way to incorporate spectral models for instruments, o
ID: 1802352 • Letter: N
Question
Now that we have created a way to incorporate spectral models for instruments, our next goal is to model the temporal dynamics of musical instruments. Amplitude modulation can be used to simulate the temporal dynamics of different instruments. This effect is achieved by multiplying a signal x(t) by a time-varying envelope a(t), where a(t) [0,1], For instance, if x(t) is the output of an additive synthesis block, then the modulated signal is given by x0(t) = a(t)x(t). A standard way to define the amplitude envelope of a musical signal is to divide it into four components: the attack, decay, sustain, and release (ADSR). The attack is a quickly rising front edge, the decay is a small and quick drop in amplitude, the sustain remains nearly constant, and the release drops quickly back to zero. See Figure 2 for an example of a typical ADSR envelope. Write a MATLAB function to generate ADSR envelopes with either linear and/or exponential rise/decay. Your function should take the times at which the envelope Figure 2: ADSR Envelope transitions between its four phases (in ms), the target amplitudes at each of these transition times (between [0,1]), and the type of transition (either linear or exponential). For instance, to model the ADSR curve in Figure 2, you would need to generate an envelope that switches between linear rise, to exponential decay, to a linear (constant) regime, and then decays exponentially (quicker decay than D phase). Use this function to generate the ADSR curves in Figure 3 and plot them. Show your work required to compute the rate of decay for each of these envelopes, i.e., show how you compute the parameters for your envelope generation function. Now, create a function that takes in a signal from your additive synthesis block and modulates the amplitude of the signal by a particular ADSR envelope. Generate example outputs from the ADSR envelopes you generated from Figure 3. You can use any primitive as input, even noise! Generate "pink noise" and use this as an input to your ADSR. Why is pink noise typically used in the audio industry? What are the differences between white and pink noise?Explanation / Answer
I have recorded 2 signals from an oscope. They look like this: I want to measure the time delay between them in Matlab. Each signal has 2000 samples with a sampling frequency of 2001000.5. The data is in a csv file. This is what I have so far. I erased the time data out of the csv file so that only the voltage levels are in the csv file. x1 = csvread('C://scope1.csv'); x2 = csvread('C://scope2.csv'); cc = xcorr(x1,x2); plot(cc); This gives this result: From what I've read I need to take the cross correlation of these signals and this should give me a peak relating to the time delay. However when I take the cross correlation of these signals I get a peak at 2000 which I know is not correct. What should I do to these signals before I cross correlate them? Just looking for some direction. EDIT: after removing the DC offset this is the result I am now getting:
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.