Assignment 3
Due Wednesday, March 4, in class.
Show your work. Have fun.
1) More sines and stuff, show your work
a) cos^{2}(θ) = (1 + ??) / 2
b) e^{jθt}cos(ωt) = exp(j Theta t) * cos(Omega t) = ??
What happens if θ = ω?
if θ = ω?
2) Linearity and Time Invariance
For each of these, say whether the system is
linear, timeinvariant, or both, and show why.
a) y(n) = x(n) + x(n1)  1
b) y(n) = x(n) + 0.9y(n1)
c) y(n) = x(n)^{1.09}
d) y(n) = x(n) * 2^{n}
e) y(n) = x(n) + 0.9^{1}x(n1) + 0.9^{2}x(n2) + ... + 0.9^{k}x(nk) + ...
f) y(n) = 7.0, n>11
0.0, otherwise
g) y(n) = x(n)  x(n1) + 0.1*x(n)*x(n1)
3) Convoluted thinking
x(n)*x(n) = x*x(n) = SUM_{k}x(k)x(nk);
( here * means convolution, not multiplication)
let x(n) = [1, 1, 0, 0, 0, ...]
then x*x(n) = [1,2,1,0,0,0,...]
a) compute and write out x*x*x(n) =
x*x*x*x(n) =
x*x*x*x*x(n) =
b) repeat all operations in (a) for x(n) = [1,1,0,0,0,...]
c) compute the mean of each (non zero) sequence segment in a) and b)
d) think (and write) a little about what's up with a) and b)
4) Filtration
a) y_{H}(n) = (x(n) + x(n1)) / 2.0
Find  Y/X(ω) 
(This is the magnitude of the Z transform of Y/X
Do Z transform of y as Y(Z) = X(Z)(1Z^{1})
Solve for Y/X, replace Z with e^{jω},
use Euler's identity for the complex exponential,
compute magnitude as sqrt(Real^{2} + Imag^{2})
b) Repeat a, but with
y_{L}(n) = (x(n)  x(n1)) / 2.0
c) what's up with a) and b)?
5) Beats Me!! Type in, compile, and run this code. What's up??
/****************************************************************/
/* First done by Risset at Bell Labs */
/* From Music, Cognition, and Computerized Sound:
An Introduction to PsychoAcoustics, Perry R. Cook, Editor
MIT Press, January 1999,
The code is Copyright, 1998, Perry R. Cook
Please keep the Copyright Notices if you redistribute. */
#include < math.h>
#include < stdio.h>
#define TWO_PI 6.28318530718
#define SRATE 44100
#include "waveio.h"
#define PEAKMAX 6000
void main()
{
long i,j,k,m,total,harm,freq;
double temp;
double amps[7] = {1.0, 0.5, 0.33, 0.25, 0.166, 0.143, 0.111};
double freqs[7] = {100.0,100.1,100.2,100.3,100.4,100.5,100.6};
short data[256];
FILE *fileOut;
struct soundhdr hdr;
fillheader(&hdr,SRATE);
fileOut = opensoundout("rissbeat.wav",&hdr); /* or .snd here */
total = 0;
m = 0;
for (j=0;j<4000;j++) {
for (k=0;k<256;k++,m++,total++) {
temp = 0.0;
for (freq=0;freq<7;freq++) {
for (harm=1;harm<=7;harm++) {
temp += amps[harm1] * sin(m * TWO_PI *
freqs[freq] * harm / SRATE);
}
}
data[k] = 2000 * temp;
}
fwrite(data,256,2,fileOut);
}
closesoundout(fileOut,total);
exit(0);
}
/***********************************************************************/
Now code it in ChucK. See how few lines it might take...
6) Do a 44.1 second musical statement using only convolution. Use at most
two original soundfiles (but you can convolve them any number of times,
cut them up how you like, reverse them, etc.). Use no other fancy
tools (you may use Goldwave or other editor for trimming or editing,
but not for any effects). Name it appropriately (prcAss3.wav) and
place it in your magical assignment place, with a descriptive text
file about what you did, what happened, surprises encountered, etc.
