*** MUS171 #16 02 24 |
Miller: @0000 This is a... -- I will come back and present this later. OK. You had to do this with sinusoids before, as way of learning abstractions. |
es: @0000 |
@0015 So, this is the same, essentially the same thing except that, the synthesis technique is one that uses delay lines and in fact, some of you already know this: |
es: @0015 |
If you want to make tones like this, @0030 you just play a little white noise or something into a recirculating delay line. For those of you who don't know it, you will see it today. So, if you don't know how to make this timbre, you will know soon how to make it. |
es: @0030 |
@0045 This idea is attributed to two people working at Stanford, Karplus and Strong. <<Kevin Karplus, Alex Strong (1983>> It is called Karplus-Strong synthesis and it turns out that it is great for making harpsichordy kinds of sounds like that. And you can |
es: @0045 |
@0060 push in a couple of ways but then, pretty much, it will give you that very recognizable timbre. And if you ever hear that, you just say; "Oh, that is Karplus-Strong." And that is kind of it. Although this is a good thing as a source for filtering. |
es: @0060 |
What I did was I just fixed it so that @0075 it has a controllable duration and has a controllable base pitch just as before. And this is a random melody but you can elaborate on that all you want. |
es: @0075 |
So, that is... @0090 now with that in your heads ... That is a thing that you do with delay lines. But, what I am going to do is show you more in general what delay lines are, like what is the range of experience that you can create |
es: @0090 |
@0105 using a delay line. |
es: @0105 |
A delay line simply takes something in and it puts it out at some amount of time later. Or, at the present time, it is putting out what it got at some previous moment. And to do it, @0120 the simplest possible example might be ... Let's just use the microphone to start with just because it will be upsetting. |
es: @0120 |
OK. So, what you do to make a delay is two things: First off, you make a delay line. @0135 And to do that, the thing is "delwrite~" . And you have to give it a name because delays, like arrays and like send and receive pairs, are things that other things refer to and they have to be able to find them by name. |
es: @0135 |
So, @0150 I will say delwrite~ and then give it a name and you also have to tell it ... Since it has to make space you have to tell it how much space to make. Unlike arrays -- delays really are just arrays. But, unlike arrays, delays are |
es: @0150 |
@0165 things that have signal running continuously through them so that they actually have a notion of sample rate. |
es: @0165 |
And, as a result, in a delay line, you specify not in the number of samples but in the number of milliseconds, which is the usual time unit. So, I am going to ask for a five-second long delay @0180 just because I cannot imagine to running more than that. |
es: @0180 |
And then, you just say "delay read" (delread~). Give it a delay name that matches the writing delay line and then give it any amount of delay that you wish to @0195 have the thing delay by. And furthermore, that is a thing that you can control using numbers. I should make a number box. ... |
es: @0195 |
So, here is the whole patch. I will just take the delay read and throw it to the output. @0210 (It is complaining to me. Why? That is me. That is this window generating problems.) OK. |
es: @0210 |
@0225 And now maybe ... If my mic is on, "Hello," yep. OK. So now, what you hear is me a second previously. |
es: @0225 |
@0240 This is a good way to really reduce the intelligibility of speech by the way. |
es: @0240 |
So, if you want to change that, you don't even have to specify the initial value. There is no storage associated with @0255 reading a delay line; it is just getting storage that was made by the delay write. And so, almost as in the signal versions of send and receive, the delay write defines the delay line and then you may have as many as delay reads as you want reading from it. |
es: @0255 |
So, for instance here, @0270 I can dial up the amount of delay that I want in milliseconds. So, here is 132 millisecond delay: And so on like that. Zero just means ..well, actually, if you say negative, it makes it zero; it cannot get less than that. And I will make that a little bit better |
es: @0270 |
@0285 by actually giving it a range. |
es: @0285 |
So, zero is the shortest delay you can make which isn't ... Well, which is basically the delay of getting through the audio system the computer has, @0300 plus Pd. And, then you get various things: |
es: @0300 |
So, certain delay times are just enough to make you queasy but not enough that you can actually hear the delay and then along right here, you get problems @0315 with speech intelligibility because there are a lot of phonemes of speech particularly the consonants that typically are over in less than 50 milliseconds and so, if you present a delayed copy of speech, |
es: @0315 |
@0330 you are squashing those phonemes out and mixing them with their neighbors which ruins the intelligibility of the speech. |
es: @0330 |
And, that becomes near total when you push it up to 100 milliseconds @0345 in which case you get a nice echo. Well, for thinking about it, 100 milliseconds ... Sound goes about a foot in millisecond. So, 100 milliseconds is 100 feet; so, that is the echo from a |
es: @0345 |
@0360 wall that is 50 feet away from you. OK? |
es: @0360 |
I am just going to save this as it is right now. It is very simple, but this is the basic deal about delay. Yes. I am going to save this except I am going to @0375 save a slightly modified form of it which is going to be this: -- Just to emphasize how "delay read" 's can reuse the same delay line. |
es: @0375 |
Now, we have the two @0390 speakers. Each of which can have a different delay and then you have this. [Clicking sound] |
es: @0390 |
Miller: Alright. And now, you play an instrument into that ...@0405 I can't hear anything ... Don't worry about that. |
es: @0405 |
@0420 Of course, delays are great effects and of course you are going to want to turn it up so that you can really hear it and that's when you'll get feedback. So delay networks are very feedback prone; that would be |
es: @0420 |
@0435 a good thing to worry about. So, this is a very simple delay patch, which I will just save. And then move on to the next ... Yeah? Audience: What is the 5000 in the "delwrite~ delay1 5000" ? |
es: @0435 |
Miller: Thank you. Yes. So, the 5000 -- that is @0450 the amount of delay line that delay write created in milliseconds. So, in order to make a delay line, delwrite~ has to allocate memory because it has to continually be remembering the last five seconds of whatever |
es: @0450 |
@0465 came in to it and so, you tell it how much memory you want to grab and you can ask it for hours, all right? But, I don't know any situation which you will need to. ... Yeah? Audience: So, would that be a "tail" then? |
es: @0465 |
Miller: It isn't really a tail. ... @0480 What is a tail? ... I don't know how to answer that. So, tails are things that happen after a sound. |
es: @0480 |
@0495 So, yes because it is creating space for making something come back after it is gone. But, you could make tails in other ways as far as you could make a purely... you could make an oscillator-based synthesizer that had a tail and then you wouldn't need a delay line to do it. |
es: @0495 |
@0510 So, really what the delay line is ... you can think of it as a circular buffer or as a loop of tape. So, what you are doing is you are writing. The memory is arranged in a circle and not in a segment and you're just writing |
es: @0510 |
@0525 around on the circle continuously so that five seconds later, you rewrite the same thing that you had written before and so on like that. |
es: @0525 |
But, in a given moment in time, you can look back up to five seconds in the past and it will still be there. ... @0540 Now, next thing about that is this: People immediately think |
es: @0540 |
@0555 of the idea of making recirculating delays and what I will do for pedagogical reasons is I will just make a very stupid design for a recirculating delay first and then I will |
es: @0555 |
@0570 start making it a little bit smarter. |
es: @0570 |
So, the stupid thing that I could do is this: Let's make this be a thousand and let's test the delay line ... Is it they are working? OK. Then we will turn it up a little bit. @0585 Now, what I am going to do is connect the delread~ back to the delwrite~ so then I will say something like, "You will never forget this." [sound repeats continuously through the delay loop] [laughter] |
es: @0585 |
Miller: @0600 OK. Let's get that out of there. OK. So, it is still there, right? |
es: @0600 |
@0615 I just turned... [laughter] |
es: @0615 |
Miller: ...OK. Actually, this is making a perfect digital copy of the thing so that it really literally will be the same thing tomorrow or next year until I of course destroy the patch which I will want to do pretty soon. @0630 Notice that I disconnected the ADC object from it. That is because, in this design, I have a little bit of a disadvantage because, well, there is... [turns on repeating sound] |
es: @0630 |
Miller: There is another thing that is going to happen which is that @0645 I can add other stuff into it: Miller: "This either." [repeating sound with added material] |
es: @0645 |
Miller: And furthermore, if I keep letting that happen, then eventually, I will just get salad, right? And then, @0660 it will just be too much. And so, what you would really want to patch and be able to do isn't just... [playback] |
es: @0660 |
Miller: ...not just that, but maybe first off, it might be interesting to be able to have subsequent echoes to be @0675 quieter than the original ones. And/or it might be a very good idea to be able to have your patch actually arranged in such a way that you could control whether you are sending a signal to it or not, alright? That would be the send delay loop. Alright. So, now...[loop plays] |
es: @0675 |
@0690 So, you got this... |
es: @0690 |
Miller: So, let's do this. OK. Now, a couple of things: One thing, this is programming style and this is little personal -- @0705 I have a tendency to try to put delwrite~'s higher on the screen than delread~ 's, so that the delay reads downward and then this line that went from the output of delread~ back up to the delwrite~ is then feedback. And it looks like feedback when you connect the output of something lower |
es: @0705 |
@0720 in a patch to the input of something higher in the patch. You don't have to do it that way because of course you could jumble around with it anyway you want. But, if you do it that way, it is easier to remember what you are doing -- which you could think is a good thing. OK. |
es: @0720 |
Now that I've done that, @0735 what I really wanted to do is make this controllable in the sort of obvious ways. I will go as far as to do that and then, I will save that and go on to make another one with gain. |
es: @0735 |
So, the important thing here is that, we want to be able @0750 to turn the input on and off so let's multiply it by...I could be brutal and multiply it by a toggle switch. By the way, just to be pedagogical again, I am going to explicitly |
es: @0750 |
@0765 add these two signals. Oh, I can't without destroying my beautiful delay loop. ... (Oh, I can. Watch this ...) |
es: @0765 |
We're going to turn DSP off. Now the delay line is just sitting there @0780 and now, I can disconnect this. If you can't follow this, this is just, it is silly. Don't worry about it. [laughter] |
es: @0780 |
Miller: Now, I am going to put a little plus in there. The patch is turned off while I am doing all of this editing, right? @0795 And now, I am going to hook this up. -- Oh, except I want to be able to control the feedback path to. So, let's do another one of these. |
es: @0795 |
@0810 I am going to be sloppy with this one. OK. So, the delread~ will go to a multiplier. |
es: @0810 |
The ADC will also go to a multiplier. Alright; @0825 I am going just to be sloppy and I am not going to use line~ 's. I am just going to use toggles. If we were doing this for serious, we would use line~ 's So, now there is a delay time which we've set the two toggles. And |
es: @0825 |
@0840 right now, with this one, I want to be recirculating this one not. And I will turn it back on: [recirculating audio] |
es: @0840 |
Miller: And now, I got something where I can just say whatever I want. [Whistling] @0855 [Recirculating audio] Miller: And finally, I can do this and get the thing shut up so, I can start over. "This is another one." [recirculating audio] |
es: @0855 |
Miller: Alright? @0870 OK. I should have done this with line~ 's instead of the toggles -- So, I will leave you to think about all these little details . Why? Because these are just amplitude controls like any other. Is it clear what this patch is doing? OK. |
es: @0870 |
@0885 It does need a couple of comments. This control should have names and they should be on the patch. So, this is going to be "recirculation." |
es: @0885 |
@0900 And, this one is going to be, I think the right thing to call this is just "send." In other words, this is a control. |
es: @0900 |
@0915 This is a send to the delay line. -- Which isn't to be confused with the "return." |
es: @0915 |
This is a sound engineering language: You call a "send" the gain by which you send some incoming signal to some kind of effect @0930 and then you would call a "return," the gain by which you would take the output of the effect and put it in whatever speakers you have. So, I don't have any return control. Well, maybe this is a return control -- it's semantics. |
es: @0930 |
But here is a send control @0945 for sure and here is the recirculation ... |
es: @0945 |
So, this is the basic recirculating delay line. All right. Now, I am going to save this. Sorry. Know what? @0960 Can I add one more thing to this patch? This has an ADC. If you are using laptops and the built-in microphones, you have a disadvantage because your |
es: @0960 |
@0975 mic is real close to your speaker. |
es: @0975 |
So, I am going to introduce a new object just to be able to ply this thing with a nice test signal. And it's going to be noise~ . @0990 I am going to be a little careful about this one and I am going to multiply it by some small number. |
es: @0990 |
OK. So, what is noise~? @1005 Noise is this: Well, you all know: [noise sound] All right. This is a |
es: @1005 |
@1020 very 1960s pseudorandom white noise, all right? It isn't truly randomness, but it is essentially what could be if you had true randomness for normal purposes. And the strict definition of it is a stream of samples, |
es: @1020 |
@1035 each sample of which is a new random number completely regardless of every sample that has proceeded it. |
es: @1035 |
So, it is a memoryless, noise-generator. And if I am not lying to you, @1050 the range is from -1 to 1 . It does not have any DC in the long term. Now, that is the good thing to be using with this for a very |
es: @1050 |
@1065 pedagogically sound reason -- which is that I want to talk a little bit about frequency responses of these things and you will be able to hear frequency responses if I use noise as the input signal. |
es: @1065 |
@1080 So, what I am going to do is ... In fact, why don't I simplify the patch; I'll just make it so you can hear the noise if you want. This is another "send." |
es: @1080 |
@1095 This is the "noise send" I guess you could call it. OK, we have noise. [noise] |
es: @1095 |
Miller: Now, what I am going to do is compare that noise to this noise that we have here. @1110 Now, both the noise and the delayed noise are being heard in the same speaker. And now, I am going to turn the delay time down to something like 10. And then you get something cool. [noise containing varying tone] |
es: @1110 |
Miller: @1125 All right. So, in went noise and out came something that had an audible pitch. |
es: @1125 |
@1140 This is the first example that you have seen at how you would make a filter. I have actually hauled out filters before because I've needed a high pass filter |
es: @1140 |
@1155 for a couple of reasons in various spots in the past, but this is actually a filter with how the filter works. |
es: @1155 |
And, what the filter does ... Well OK, I will say what the filter does @1170 in two different ways. One thing that the filter does is it takes the incoming sound and lets you hear it but also lets you hear it with a delay. So, you hear two copies of signal with seven-ish milliseconds between them. |
es: @1170 |
Another thing that you hear @1185 is that certain frequencies are accentuated in the output and certain other frequencies are not. And that is the aspect of filtering that makes us call it "filters" -- the idea that different frequencies that come in are passed through more |
es: @1185 |
@1200 willingly than other frequencies. ... Yeah? Audience: For the noise~, what does the inlet do? |
es: @1200 |
Miller: Nothing. I was too lazy to...I just forgot when I was @1215 writing it to tell Pd to suppress drawing the inlet, so it just has the inlet. ADC also has an inlet that does nothing.[laughter] |
es: @1215 |
Miller: There might be one or two others and every once in a while that question comes up Pd-list. So, the moral is, doing nothing is @1230 often not quite nothing enough. ... So, Just to analyze what this thing does... So, let's make it for ease of thinking about it, |
es: @1230 |
@1245 let's make this thing 10 milliseconds: |
es: @1245 |
So, now we hear a pitch and, what would that pitch be? Well, OK. To think about that;@1260 What would happen when you put certain sinusoids...? -- "Oh, rats." I am skipping some theoretical stuff. So, I am not explaining that you can think of incoming sound as consisting of sinusoidal components. |
es: @1260 |
@1275 When and in what sense you can do that is something that the audio engineers just sort of assume and which I will not tell you more about than just to assume it, all right? |
es: @1275 |
Because the mathematics is hairy. So, @1290 assuming that you think that some very complicated signal like noise~ might actually consist or be describable as a sum of different sinusoids of different frequencies. |
es: @1290 |
And, of course, it's folk knowledge that white noise really is @1305 every single frequency with equal amplitude just like white light could be every single optical frequency at the same amplitude although it isn't because it depends what temperature is. |
es: @1305 |
But, that is another thing that we don't have to worry about. White noise in @1320 audio land really is a signal which contains every frequency that the digital signal can represent and it contains them all with equal amplitudes and we will just sort of forget about DC and the Nyquist for now because these might be special cases. |
es: @1320 |
All right. @1335 If you think of that that way, then what about some possible component frequency of the noise signal? For instance, what if there were a 100 Hertz sinusoid |
es: @1335 |
@1350 sitting in there? Well, you would hear the 100-Hertz sinusoid here and you would hear the 100-Hertz sinusoid one period later because the period of 100-Hertz sinusoid is 10 milliseconds. |
es: @1350 |
@1365 All right? |
es: @1365 |
And so you will get the same signal coming out of here for 100-Hertz sinusoid as you get coming out of here and so it would be doubled in amplitude @1380 and sound somewhat louder. |
es: @1380 |
If I put in 50 Hertz, then something different happens because 10 milliseconds in a 50 Hertz signal ... the 50-Hertz signal has a period of 20 @1395 milliseconds. So, 10 milliseconds is long enough to wait for the sinusoid to change sign -- No matter what phase it had at the outset, it is going to be minus what it was by a half-period later. |
es: @1395 |
@1410 What that means is that, at 50 Hertz, this signal has the amplitude which is exactly the negative of the amplitude of this signal -- and they cancel each other out. |
es: @1410 |
@1425 And since we're adding -- since we're putting it out both here and here at the same amplitude -- we're not putting anything out at 50 Hertz. |
es: @1425 |
Now, if you want me to really prove that ... @1440 prove it? -- prove it as in a laboratory. Let's make nice oscillator and let's ask it to play 50 Hertz for us. And then I will turn it up here although maybe not all the way to 92. |
es: @1440 |
@1455 50 Hertz is kind of low, all right. And then I will turn it up here too. Dig -- It went away. |
es: @1455 |
I hope this is maybe on the tape. @1470 Oh, you know what ... let's do the same experiment, but let's do it at a lower delay and a higher frequency. So, now, what I am going to do is make the delay be a mere 2 milliseconds. Now, we got it back ... but I am going to make the oscillator |
es: @1470 |
@1485 to be 250 Hertz. So, now you can hear the oscillator just fine if I just play at... [tone at 250 Hz] |
es: @1485 |
Miller: ...but if I add the delayed copy, then it goes away. @1500 Alright? If on the other hand I had the oscillator going at 500 Hertz, then, if I add the delayed copy, it just makes it louder, |
es: @1500 |
@1515 6dB louder to be explicit, and so on. [500 Hz tone] |
es: @1515 |
Miller: So, just proving this thing with oscillators -- which is a perfectly respectful way to find out what a filter does, by the way. @1530 What happened is, oh, at DC -- I didn't tell what happens at DC. But of course, if you put a constant signal on delay line, we will get the same thing out after any delay that you want. And so they will add: the delayed copy will be the same as the original. |
es: @1530 |
@1545 So, very low frequencies will come out.[rising tones] Miller: But, by the time I hit 250, it will be gone. And then, by the time I go to 500...[tones changing pitch and amplitude] |
es: @1545 |
Miller: ...It comes back @1560 at double strength. And then at 750, it goes away again. Now, that is worth stopping and worrying about for a second. Why did that happen for 750? |
es: @1560 |
@1575 So, what is the easiest way to do the math here ... |
es: @1575 |
So, 250 Hertz, this one: the period of this is four @1590 milliseconds and the delay line is two milliseconds which is one-half of a period; all right? If I make this 750, then the period of that is ... 750, |
es: @1590 |
@1605 right |
es: @1605 |
if it were 1000 it would be 1 millisecond, so it is 750, @1620 so it is 4/3 of a millisecond; a millisecond and a third. |
es: @1620 |
And then, if you make a delayed copy two milliseconds later, ... @1635 A period is a millisecond and a third. So, how many periods then fit in two milliseconds? I was trying to make this |
es: @1635 |
@1650 easy to do in one's head, but it isn't. I'm sorry. |
es: @1650 |
It's one-and-a-half period: We have one and a third millisecond, that is four-thirds, and then a half of that again is two-thirds. And four-thirds plus two-thirds is six-thirds or 2. @1665 This is one-and-a-half of these periods. So, what that means is that we're hearing here and we're and hearing it there, not a half period later but one-and-a-half period later which for practical purposes is the same thing. |
es: @1665 |
@1680 Similarly, if I go to a thousand, now the period is 1 millisecond, and 2 (milliseconds) is then two periods. |
es: @1680 |
@1695 So, 2 -- that number is fixed for now -- is a 1/2 period of this one. It is 1 period of this one. It is 1.5 periods of this one. It is 2 periods of this one. It is 2.5 periods of this one ... and so on. |
es: @1695 |
@1710 Oops! What happened --Why do I hear that? -- The reason I hear it is truncation error. |
es: @1710 |
@1725 This is 2 milliseconds, but we're running at a rate of 44K1, so the delay isn't exactly 2 milliseconds -- and so, I didn't succeed in notching it out exactly. |
es: @1725 |
@1740 And so you hear a very quiet little tone; it might be 40 DB down. But you are hearing the error in the allowable length of the delay line. So, there is a thing about delay lines that I have to tell you about: |
es: @1740 |
Miller: -- @1755 A thing about delread~ that I have to tell you about, which is this: It will read an old sample of the signal that is going down the delwrite~. But, it is limited to integer numbers |
es: @1755 |
@1770 of samples of delay. It won't interpolate for you, try to guess what thing would be at say "5-1/2 samples ago." It will either do 5 samples ago or 6 samples ago. So, going back to this example: Truncation |
es: @1770 |
@1785 error is sort to give me the lie ... Well, I will continue the experiment anyway. So: -- 250? No. -- 500? Got it. -- 750? No. -- 1000? Yes. -- 1250? Almost no. -- |
es: @1785 |
@1800 1500? Yes. -- 1750? Almost no (still there). -- 2000? Yes. ... OK. |
es: @1800 |
So, the things that got through were 500, 1000, @1815 1500 and 2000 -- And seeing the pattern, it's going to be all the multiples of 500. And all of the numbers half-way in between those multiples, integer multiples of 500 -- |
es: @1815 |
-- @1830 All the half integer multiples of 500 -- like 250, 750, 1250 and so on -- are getting "notched out" as an audio engineer would say. They are getting canceled out by the delayed copy. |
es: @1830 |
@1845 Now, going back to the example of noise ... (Should I add that? ... I should add it. ) |
es: @1845 |
This is the oscillator send. And then I will just make a separate one @1860 for the noise, so that it's all nice and clear. So, I'll put an adder here |
es: @1860 |
@1875 and I will make yet another one which is a noise~. Ah ... it is going to fit? (Duplicate ... |
es: @1875 |
@1890 all right. It's getting messy. We're going have to stop real soon.) Of course, it's "noise" not "oise" ... Now, we're going to add that; and then |
es: @1890 |
@1905 we're going to throw that in here. ... (By the way, I am being a little sloppy there. I am using this inlet of add to be another add. So, this is a stylistic thing for me: You just put a plus~, then you throw as much stuff into it as you want, it's making it clear that it is all getting added anyway. |
es: @1905 |
@1920 Better than just throwing it all in the inlet here, for some reason.) |
es: @1920 |
So, now, we're sending the oscillator ... we're listening to ... want to hear it here ... And now, we're going to hear the oscillator: [tone] We're going to check this.... @1935 The amplitudes by the way need to be exactly the same for this to work perfectly. All right, so that was the oscillator example. And here is the noise example: [filtered noise sound] [noise] |
es: @1935 |
Miller: @1950 And then, you get a thing which is roughly 500 Hertz which, you know, it isn't too far from the C above middle C here: [piano] |
es: @1950 |
Miller: @1965 OK. So, that is the 500 Hertz tone, sort of. -- You could compare it to what happens when I make the oscillator to be 500 Hertz. OK. Observations about this? |
es: @1965 |
@1980 (I am going to save this and now really, it's time for me to start a new patch because it is getting too crowded. This is the end of this patch.) |
es: @1980 |
So, observation about this: This is a linear process. The @1995 "linear process" meaning: Taking a signal and making a delayed copy of it and adding the two or even not. So ... adding any number of delayed copies of the signal |
es: @1995 |
@2010 to the original signal is a linear process in the sense that: If you add two signals in, you will get the result of what happens if you put the two signals in separately. |
es: @2010 |
It is furthermore time-invariant which on means: @2025 If you put something into the network now or if you put it in a minute later or a second later, you will get the same thing out as if you just put the original thing and just done the whole thing a second later. |
es: @2025 |
@2040 You could have things that are not time-invariant. A very good example of something that isn't time-invariant is multiplying by a sinusoid, that's to say ring modulation. Because at one moment it is putting the thing through positive, and one moment it's putting the thing through negative. |
es: @2040 |
So, if you put an impulse into it @2055 at some point, it would be positive or negative or nothing depending on when you put the impulse in. So, that isn't time-invariant. This is time-invariant. If you put an impulse in here at any time or any other time, you will get the same thing out, simply at that time. |
es: @2055 |
@2070 It is a property of linear time-invariant systems that you can fully describe them by finding out what they do to sinusoids. |
es: @2070 |
@2085 The way in the past that we have generated frequencies that weren't present in an incoming signal ... |
es: @2085 |
... So, there have been lots of examples where you have an oscillator and then you make @2100 different frequencies come out either by multiplying it by another oscillator, which isn't time-invariant -- or by running it through a nonlinear so called "transfer function" which is waveshaping. |
es: @2100 |
Each of those things is capable of generating frequencies that aren't present in the original signal. But it is in general @2115 true about a linear time-invariant transformation that if you put a sinusoid in, you will get a |
es: @2115 |
@2130 sinusoid out of that same frequency. ... Yeah? Audience: Would you explain time-invariance again? |
es: @2130 |
Miller: OK. So, time-invariant is this: @2145 It's a process and it has an input and output. And so ... Make an input, run the process and get the output. And now, I will make the input delayed by any amount of time you want and apply the same process, |
es: @2145 |
@2160 you will get the output delayed by the same amount. So, the laws of physics are believed ... are probably ... time-invariant. Because if you drop an apple today or drop an apple tomorrow, the same thing happens -- although it happens a day later. |
es: @2160 |
Audience: And then explain why @2175 multiplying by an oscillator isn't time-invariant. Because it depends on what phase that oscillator's at? Miller: Yeah, right. Audience: Got it. OK. |
es: @2175 |
Miller: OK. So, I am not going to try to explain why a linear time-invariant @2190 system has this wonderful property. But, good things about these .... Well, it would be good if your amplifier was linear and time-invariant ... |
es: @2190 |
@2205 It would also be good if your speaker system was, right? Because if you heard frequencies coming out of your speaker that weren't in the recording or thing that you are generating, then you would think that there is something wrong with the speaker. Like you would call it "harmonic distortion" |
es: @2205 |
@2220 or something like that. |
es: @2220 |
Linear time-invariance doesn't make up frequencies for you. It does however, or can however, change the amplitude of sounds at different frequencies. In other words, it can change amplitude in a @2235 frequency-dependent way. And this is a very simple example of that, where I am throwing in sinusoids and the happy ones that are multiples of 500 are getting doubled in amplitude and the ones that are happening between them are getting zeroed in amplitude. |
es: @2235 |
@2250 So, that is a thing which we would call a "filter" -- or I don't know what, historically. But everyone I think has this folk knowledge of what a filter |
es: @2250 |
@2265 should be and do. And this is basically how you make filters. You make them out of delays. |
es: @2265 |
So, delays now ... I don't want to change the patch, but I will... @2280 Let's go back to doing the "send" thing ... We're sending and oh yes ... so, I why don't I make the patch even more readable than it was by doing the same thing to all |
es: @2280 |
@2295 the three sources, which is to say adding them up like that: |
es: @2295 |
That didn't make the patch very much more readable ... Then I can lower these ... there. ... @2310 So now, here is the original patch maybe, let's see: I have to make it a little louder before this is good for anything. So, now this is my voice being filtered in the same way |
es: @2310 |
@2325 and you, might be able to tell that there is some kind of timbral variation. Actually, you will hear it clearly if I turn the filtering off. So here's original voice. (You hear some proximity effect because the mic is too close to my voice and the gain is too low.) But, it is basically what is going in. |
es: @2325 |
@2340 And here is now the filtered result: Which is, you know, 500, <<mis-spoken as 5,000>> 1500 and 2500 accentuated everything else, other frequencies not. |
es: @2340 |
@2355 Or, yeah ... You could now say, "Let me have this as a continuously variable process... So, "Aaaahhhh," --- I don't if you can tell anything's going on there. |
es: @2355 |
@2370 But, what you are hearing is a varying filter. I am doing this in a rather sloppy way. In fact, I can do it in a more easy to understand way by using noise again with less amplitude. [noise] |
es: @2370 |
Miller: @2385 And now, we can do that sort of stuff [frequencies in the noise change] ...OK. And, that is changing the |
es: @2385 |
@2400 frequency response of the filter. What is a "frequency response?" Frequency response is a name for, at any given frequency, what is the gain of a filter? |
es: @2400 |
@2415 So, the frequency response is a curve or it is a function of frequency -- which in this case has a shape like that: Has peaks at multiples of a fixed frequency. And you can change that fixed frequency, which is therefore |
es: @2415 |
@2430 changing the frequency response of the filter in thiw very audible way. |
es: @2430 |
Now, that is what the filter is doing for you when you have very @2445 short delays. Let's go back to voice now. This is a thing which either can give you this kind of effect, "Hello." ... "Hello." |
es: @2445 |
@2460 So, now, we're doing something that you hear in the time domain. |
es: @2460 |
So, that now, the delay time now is more than the magic 30 milliseconds which is something like the threshold of what you will hear as a time interval. So, @2475 if it is more than 30 milliseconds, you get this: And if it is less than 30-ish milliseconds, you will start getting things that are describable as filters. |
es: @2475 |
And, by the way, notice, I've been sloppy about this @2490 without explaining to you that this is a problem. But, of course, if you test this thing carefully, you will hear that it does that: [jitters] when you change the delay time, all right? |
es: @2490 |
@2505 That's exactly the same effect as if you were using an array as a sample, as a recorded sound, and suddenly jumped from one spot in the recorded sound to another without controlling it by enveloping it somehow. |
es: @2505 |
@2520 And, it is that for the same reason almost -- which is that if you change the delay, you are stopping playing the thing at one delay, you are starting playing it discontinuously another delay. It is almost exactly the same thing if you picked the needle up on a recording and dropped it |
es: @2520 |
@2535 somewhere else instantaneously; it would cause a discontinuity in the signal. And, that wasn't a problem before because I was changing it |
es: @2535 |
@2550 by small enough amounts. I was doing this with the shift-key. You can still hear that it's a problem but I was able to sort of talk over it hide the zipper-noise effect. But, now that I have sensitized it you should hear it. |
es: @2550 |
@2565 Well, that is this patch in gory detail. I haven't turned the recirculation back on |
es: @2565 |
@2580 since I have been doing this for a good reason -- which is that the recirculation made sense when I had the delay time up to some large value ... |
es: @2580 |
So, the recirculation example was, I had 1000 here. And then I could do something like: Turn on the recirculation @2595 and then give it a couple puffs of, say an oscillator. OK. So, now I can just say [injects the oscillator sound] |
es: @2595 |
@2610 This is now back to what I did at the very beginning of the class which is just a recirculating delay network. ... Where |
es: @2610 |
@2625 you don't want to be putting things through in a continuous way -- which is what I have been doing, when I've been describing the way this thing acts as a filter. |
es: @2625 |
You can actually think of this is a filter, @2640 but it wouldn't be a really good filter because its frequency response would be infinite at any frequency except one that was very carefully chosen to be notched out. |
es: @2640 |
@2655 To put that another way: For instance, if I just put DC into it, if I just put a signal that had a constant value of 1: It would just add on to itself then it would continue doing that forever and eventually, we will have an arbitrarily large |
es: @2655 |
@2670 number coming out. |
es: @2670 |
So, this is out of the range of operation where you really will think of it as a filter. This is using it as something else -- @2685 I am not sure what. So, delay lines are usable as filters but there are delay effects which would be unstable if you left them in place for any amount of time and so you can't regard them as a thing which you can do in a continuous way in time. |
es: @2685 |
@2700 And therefore, you probably should not use them as filters but as other things. ... Questions about this? Audience: How would you remove the zipper-noise from the changing delays ... ? |
es: @2700 |
Miller: How would you @2715 remove the zipper noise? I've been saving that for a little later because there are couple of ways you can do it any way that you want. ... Yeah? |
es: @2715 |
Audience: @2730 Can you find the delay you need to get a particular pitch? Miller: You can do it. In fact, you have to do it to be able to do the homework. [laughter] |
es: @2730 |
Miller: @2745 So, what's the formula. Yeah. So, for instance, if I wanted to do middle C... Audience: Calculate a formula? |
es: @2745 |
Miller: @2760 Well, yeah ... And I've been resisting hauling out the expr~ object which allows you to just type out formulas -- which is of course a great thing to be able to do but there's syntax. I haven't yet found a thing that's really been unavoidable. |
es: @2760 |
@2775 But, how would you compute? ...OK, so 1 Hertz should correspond to a thousand. ... 2 Hertz should correspond to 500, and so on like that. So, the general formula is: this thing should be 1000 divided by the frequency in Hertz; |
es: @2775 |
@2790 and to divide a thousand by something, so it is...This is worth knowing how to do: |
es: @2790 |
So, here is a number. We're going to convert it to @2805 frequency, MIDI-to-frequency <<mtof>>. And then, that's going to give us a nice number again which I will look at. But, now what I want to do is take 1000 divided by that. |
es: @2805 |
So, to do that, OK. So, I need 1000 down here, @2820 which is a message because I don't want that value to change; and then I want to divide that by this number: |
es: @2820 |
@2835 I will take 1000 divided by this, but we have to then bang the 1000 after we put this number in and so, we need a ..? Trigger! |
es: @2835 |
Yup, trigger, bang, float @2850 and I usually space this like this when I am doing this. |
es: @2850 |
I think that is decently readable. And now, we do this! -- Destroy the coherence of our patch. @2865 And now, I say, "middle C, please" and it says, "Yeah you want 3.822 milliseconds." And theoretically, now, if we play noise to this ... get these two gains the same. Yeah. |
es: @2865 |
@2880 That should be this pitch. Middle C. [piano sound] |
es: @2880 |
Miller: All right. One other thing I should warn you bad about this. This is @2895 abstruse and weird: There is a minimum amount of delay that you can get into a recirculating network for a technical reason which is that Pd does everything in blocks of 64 audio samples just to save computation. |
es: @2895 |
As a @2910 result of which -- since the delwrite~ needs the delread~ 's output to be able to write into it -- that output is a block and so, the minimum amount of delay which you could have in this loop is one block worth. |
es: @2910 |
@2925 And, without trying to explain that any better than I have already, what I am going to do is to show you that ... everything is hunky-dory until you get up to a certain delay here: [noise with changing components] |
es: @2925 |
Miller: @2940 And then, it stops. Stops right at ... I think, it stops right at 1.45. |
es: @2940 |
@2955 And that 1.45 is the number of milliseconds in 64 samples at 44,100 sample rate, if you compute that. -- (You don't have to compute that now. |
es: @2955 |
@2970 I hit that number a lot because, well, it is the length of a block of 64 samples of time.) That also is the numerical accuracy of the line object if you ask it to do something in a specific time. |
es: @2970 |
@2985 The time actually will be the nearest one of these -- which can be a limitation. And if that is a limitation, go look up the vline object, which corrects for that. |
es: @2985 |
OK. So, I did @3000 promise you I was not going to add stuff to this patch. So what I'm going to do... I am going to save this. What can I do? OK. I kind of ought to leave this in; |
es: @3000 |
@3015 I am going to use a send here. I don't know how I am going to deal with making |
es: @3015 |
@3030 this be a readable patch when I try to put it up on the web. [laughter] For now, we'll just do this. ... |
es: @3030 |
@3045 "r" is short for "receive" ... so I should use "s" here to be clear. So, there's that. |
es: @3045 |
Miller: Now, the next topic is @3060 what if you want to have a recirculating delay and not have it last forever the way I had it last in this example? And of course, it is easy -- You just take it and multiply it by some gain that is less than 1 each time around. But, even though that is easy, I want |
es: @3060 |
@3075 to show it you because it has interesting ramifications and there are actually things that you can think about it. |
es: @3075 |
So, now I am going to "Save As" .. that was 3.delay-recirculate. So, this is going to be @3090 4.delay.gain.recirculate. <<Saving "2.24/4.delay-gain-recirculate.pd">> Sorry, long name. Here, what I am going to do...see, I am not sure what incoming signals we need.... |
es: @3090 |
@3105 So, now, what I am going to do is I am going to make one where the assumption is that we're always recirculating. |
es: @3105 |
So, instead of having the recirculating be on and off, I will make it be a nice number box. @3120 And in fact, I think what I want to do is have the number to be in one-hundredths for sanity's sake. |
es: @3120 |
And now @3135 that I have done that, so, I am going to increase the...well, actually, let's be middle C still. And now, I am going to say "noise please." It is going in there. So, we can listen to it. [noise] |
es: @3135 |
Miller: OK, now all you @3150 hear there is unfiltered white noise because the noise is going in... (You know what? I am going to make an improvement to the patch. I'm going to listen to the output of this adder. |
es: @3150 |
@3165 OK. And, now, we still hear it. Yeah. [noise] |
es: @3165 |
Miller: @3180 Now, we're putting noise in. We're not putting the oscillator in or the, ADC -- just noise. And the noise is getting multiplied by 0 as it gets read and then recirculated, so we hear nothing but the original noise. As I turn this value up, |
es: @3180 |
@3195 I get more and more recirculation which gives me a more and more nearly pure tone. [filtered noise changes] |
es: @3195 |
.. @3210 I am going to stay away from a hundred for now. OK. So, now, to go back to, not 1000 this time ... how about |
es: @3210 |
@3225 150? OK. Now, I am going to go back to talking into it. So, now, I am talking into thing and you hear just my voice with no delay. And now, I turn up the recirculation. [sound] |
es: @3225 |
Miller: And now, everything that you hear has several copies. @3240 OK. And now, this is the thing that you heard probably in piano country ... push my input gain up .. [sound] |
es: @3240 |
Miller: [piano sound] @3255 At least from where I'm hearing, I don't here the effect at all. |
es: @3255 |
Miller: @3270 But, I am afraid to turn it up, so that's no longer true because at some point, we're going to get feedback and then it's going to be bad because I will be over there. ... |
es: @3270 |
@3285 Actually, I have a switch, but I am not sure I would think in time for that ... |
es: @3285 |
So, here are these these delays. And now, what is happening right now is that each delay is 63 percent as loud as the previous one. Oh, this is it: @3300 "Hey, you guys! don't listen to that." [laughter] |
es: @3300 |
Miller: Yeah. OK, so the bigger I make this, the longer the sound stays around until I foolishly push this past a hundred: [sound increasing in volume] @3315 And then it actually grows. Miller: And, you don't want to leave it like that. That is an unstable filter; right? Filters can be unstable and what happens when you have an unstable filter? Pretty soon everything is just, "waakrraak," |
es: @3315 |
@3330 So, you can do it. It's mathematically possible. But it might not be what you want really. All right. So, this now is making a recirculating delay. |
es: @3330 |
@3345 So things about it: It's is very feedback prone. Use with caution. It also it is a bit of a special effect and it is way overused. The other thing about it is -- This is close to |
es: @3345 |
@3360 what you do it from an artificial reverberation. |
es: @3360 |
So, if you wanted to make me sound like I was speaking in a church or a music hall, or something like that, you would do something like this except that you would want the echoes @3375 to be a lot closer to each other in time like this. "Hello." [sound] |
es: @3375 |
Miller: And then, you have to turn the recirculation up. And then we get something a little bit unexpected, some feedback here. @3390 Re-direct the audio ... yeah "cardio" mic. If you do this, theoretically, you are not getting any direct signal out of the speaker. Doesn't really work, you can at least hope it does. So, now, |
es: @3390 |
@3405 it isn't a nice continual reverb sound at all. It's got a pitch. |
es: @3405 |
The reason I dropped the delay time into something short ... right now, it's 13 milliseconds. The reason I dropped that was so that @3420 the echoes would be close to each other. Because when this was a larger value in milliseconds. (I am going to drop this a little bit now.) Then, you just heard... [echo] then you heard a bunch of echoes ... So, this isn't a nice reverberator |
es: @3420 |
@3435 because you know ... You play a trumpet through that ...? OK. Sounds like "Come Together" ... But, if I decide to try to make that echo denser, then I can get...[sound] |
es: @3435 |
Miller: @3450 I'm down below the magic value of 30 and I start getting pitches again. [sound] Miller: In fact, at this point, I can just dial this thing up like this: "Hello, this is your professor on drugs ..." [laughter] |
es: @3450 |
Miller: @3465 Now, all I am doing is filtering ... So, there is some things I haven't told you about this: |
es: @3465 |
@3480 It was perfectly filtering before I put the recirculation in. But, you noticed that when I put the recirculation in, then the filtering got a lot stronger. |
es: @3480 |
That is the loose way of saying it. What really happened was I replaced the @3495 non-recirculating filter with a different filter which is recirculating which has the property that can have a very, very sharp resonances which you will perceive as pitches. And this is the Karplus-Strong |
es: @3495 |
@3510 technique that I referenced in the homework at the beginning of the class. This is a thing which -- no matter what you put into it -- out comes ... [sound] |
es: @3510 |
Miller: A thing that is happening at the pitch that you dialed up here. @3525 And furthermore, what you do is reflected in a timbre of what comes out. So different kinds of impulses going in give you different timbres coming out. [sound] |
es: @3525 |
Miller: It's a little bit like what happens on a stringed instrument @3540 when you pluck it: Those of you who play guitar, when you pluck the string, the sound of the tone is pretty much the sound of the pluck dying out. Of course, the higher frequencies die a little faster than the lower -- so that isn't quite true. |
es: @3540 |
@3555 But, the moment that you get to really control the timbre of a guitar or piano string is just when it gets hit -- because after that it's just ringing -- |
es: @3555 |
It's doing it's own thing after that. And, this is ... Well; it's a fairly close imitation of that process. @3570 It is at least a conceptual imitation of it, where you put the signal on the string. It runs down the string and comes back up and you get it again and every time it goes by, you get it again, right? So, a guitar or a stringed instrument,, in some sense, you could think of as being |
es: @3570 |
@3585 a recirculating delay line. And that turns out only to be an approximation. But, it's a good enough approximation to capture certain aspects of it. Here, try as you might, it is going to be hard to make this actually sound like a guitar... [sound] |
es: @3585 |
Miller: @3600 It sounds like...It sounds like a computer trying to be a guitar. If you give it something that has more high frequencies...Then, you can |
es: @3600 |
@3615 almost get, make yourself believe that you are hearing a struck string of some sort like a string being hit without mallet of some sort. |
es: @3615 |
And, furthermore, if you could -- @3630 I am not going to build a patch to do this right now -- but, if you could turn this noise on and off very, very rapidly so that you made a burst of noise, then you would get a very sharp signal that would sound -- in |
es: @3630 |
@3645 the same way that that FM tones sounds like a clarinet -- |
es: @3645 |
That would sound like a harpsichord. And in fact, that is exactly what I did in my patch here which is the homework demonstration patch ... which I might still have up. @3660 Let's see ... looks like I got rid of it. So let's go get it again. So, this thing: [harpsichord music] |
es: @3660 |
Miller: @3675 All right. So, the homework is simply to take this principle and build it into nice polyphonic instrument |
es: @3675 |
@3690 so that it can do something reminiscent of homework 6, two weeks ago. And of course, you will be tired of that stupid random melody, so you can make something more fun. Yeah? Audience: With this process, is this kind of like a basis for vocoder? |
es: @3690 |
Miller: @3705 It sounds a lot like a vocoder. In particular ... Well, the thing it makes a sound like a vocoder is when you put your voice into it. You can almost think of it as an alternative to vocooder. All right. |
es: @3705 |
@3720 It will not do it anymore. Sure enough. So, why don't I hear anything now? That is weird. OK. Let's turn DSP off. |
es: @3720 |
@3735 "Hello." Audience: Is there a preview switch on your port? |
es: @3735 |
Miller: There might be. I'm not going to look for it now. I think there is probably a monitor switch down there that's turned on, all right. @3750 Sorry about that. So let's ignore that for now and what I will do is just start sending the ADC to this and now we get: "Hello." Yeah. So now this: So the question is, "Is this a vocoder?" And the answer for me is -- |
es: @3750 |
@3765 First off: A vocoder usually lets you put the sound in that this thing is forcing you just to be -- pitch of 60. So, a vocoder's a more powerful thing than this in some ways -- in a lot of important ways. |
es: @3765 |
@3780 Another thing is that if you compare this to the standard vocoder sound, the vocoder sound is a great deal more local in time. So, this does not respond real fast. In particular, it does not |
es: @3780 |
@3795 shut up real fast when you stop talking. |
es: @3795 |
So everything gets squashed out over a certain period of time, which a good vocoder wouldn't do to you. So, you could, you know ... This is almost, this is a "cheap wannabe vocoder." ... @3810 Any questions about that? ... Yeah. |
es: @3810 |
Audience: Right now, you have only the recirculated sound. How would you combine that with the @3825 original audio? Miller: Oh, that would be easy. You would just... Audience: It is just like ADC? |
es: @3825 |
Miller: You'ld get another level control, yeah and then you get the ADC and just send it straight out like that and then, this would be the @3840 so called "dry signal" in audio parlance and this would be the "wet signal." Audience: Can you put them together? Miller: You could; so you could add the ADC into this and then ... Yeah. |
es: @3840 |
Miller: @3855 Yeah. You could do that. So, it's more a question of just how you wanted to define that, or how you want the interface to be, all right. Because basically, it boils down to two different levels, one or another. |
es: @3855 |
@3870 All right. So, the thing that I want to tell you about the -- |
es: @3870 |
@3885 I am realizing, 15 minutes left ... Do I really want to explain why the frequency responses is what it is, or do I want to not touch that with a pole? |
es: @3885 |
@3900 I am going to tell you how you would find out and I am going to avoid going into the gory details -- for the simple reason that it might be useful to come back to this in |
es: @3900 |
@3915 two weeks' time and so it will have been nice to have gotten started and then ... Anyway, if I never manage to follow up on it, then you've at least seen where you can find more about it. |
es: @3915 |
So, this is now a tour through theory. @3930 So, let's go over here: Book. So, we're now on Chapter 7 of the book which is time-shifts and delays. Chapter 8 of the book |
es: @3930 |
@3945 is Filters. And filters are really, as I've explained, they really just a psychological...they're point of view on |
es: @3945 |
@3960 time shifts. |
es: @3960 |
In other words, filters are made out of combining signals with time delayed copies of themselves, including the possibility of recirculation -- which as you've seen simply has the effect adding more and more copies in it. @3975 Basically, it just adds a train of copies, instead of a single copy, if you make the thing recirculate. So, if you learn all about time delays, time shifting (which is time delaying |
es: @3975 |
@3990 if you make it a real time process)... If you know all about that then one of the things you can ask is, "What is the frequency response of the network?" And a good definition of a filter I think is: It is a delay network that was designed in order to |
es: @3990 |
@4005 give us particular frequency or phase response, usually frequency response. |
es: @4005 |
So, one thing that you want to know about in delays is how did you predict the frequency @4020 response and then when you are doing filtering, it's not just how do you predict the frequency response but, "I want a frequency response that acts like this. How would I set about designing a filter that had that?" |
es: @4020 |
So, filter design in some sense turns the @4035 question around: Whereas, in a delay, if you are just making delay networks, you might just sort of ask, "What would the response be?" In the filter thing, you posit the response and work backwards to get a delay network that does it for you. At least, that is the way |
es: @4035 |
@4050 I think of it. |
es: @4050 |
Delay networks have other things that you can talk about, about them, besides the frequency response but I just want to talk about that for now in order to prepare for whatever little bits of filtering we're able to get into in the last week pf class, @4065 before we do GEM -- which is of course what everyone really wants to see. |
es: @4065 |
And, what I want to do is just talk about -- I'm going to take this slightly out of order because I am going to motivate the jive about complex numbers by showing you @4080 first how you think about time shifts and how they change the phase of a thing. |
es: @4080 |
So, just to do the hand-waving thing: Of course, shifting a signal in time such as delaying it, changes the phases @4095 of all the component sinusoids. (And of course, I shouldn't say "of course" there because that is presupposing the deep thing that you think that you can think about a signal as being the sum of sinusoids in the first place.) |
es: @4095 |
But, if you could, and if you have something linear and @4110 time-invariant, which we do, so that we're not making up frequencies that we didn't have before and so on like that ... Then you can say "Yes. I will just describe what this thing would do to a sinusoid and that will describe what it does to anything." So, then we say. |
es: @4110 |
"All right, we're just going to send sinusoids down our delay @4125 network and ask what happens then." And the answer is: you put it down a delay and you get out a sinusoid of the same amplitude and a different phase. |
es: @4125 |
And, then if you, for instance, add that to a non-delayed copy of the signal, then you will get phase @4140 cancellation or not depending on the relationship between the two phases you got. |
es: @4140 |
So, if you can predict the phase, then you can go do the math and work out what that response is going to be. So, how do you predict the phase? Well, @4155 it is easy: The frequency of a sinusoid is just how much the phase changes from one sample to the next. |
es: @4155 |
So --and if you do it in appropriate units --the @4170 phase change associated with the delay of say, D samples which is going to be D times the frequency, actually, -D times the frequency of the sinusoid that you put in. Why minus? Because |
es: @4170 |
@4185 if you delay it, then you listen to what it was earlier in time, so it is actually phased backwards. But, if you think too hard about that, |
es: @4185 |
@4200 then you will get mixed up. So, it is best to just sort of remember it's minus D times the frequency -- If you express the frequency as degrees or radians per sample - which is the good way to describe frequencies in |
es: @4200 |
@4215 filter design land. |
es: @4215 |
So, time shifts and phase changes: What is a time shift? A time shift is just, "I give you a signal X and you give me a signal Y which is X, @4230 D samples ago." And N is just now. N is the number 1, 2, 3, 4, and so on. |
es: @4230 |
And then, what happens when you time shift a? -- Oh! Now, I have to go back. OK ... @4245 So, I am motivating complex numbers. If you have a real-valued sinusoid, it is ugly, it is cosine of omega N plus pi ... So, call it cosine of omega N ... |
es: @4245 |
@4260 It's the cosine of something, maybe there's an amplitude ... If I gave you a sinusoid that contained only a positive frequency, it would be complex valued sinusoid with |
es: @4260 |
@4275 a simpler formula. Which is that: The nth sample, so "X sub N" -- that's the Nth sample of my sinusoid -- is some constant amplitude times a complex number raised to the nth power. |
es: @4275 |
@4290 That's all it is. |
es: @4290 |
So, a sinusoid is an exponential exponential sequence. And then, it's really easy to say what happens when you delay it. Because if you take an exponential sequence and delay it -- You've all had to do this, @4305 because you had to add exponential sequences in high school -- "geometric sequences" they're called. So, adding geometric series: What you do is consider what happens when you just delay it and then subtract it off from the original and you just get a multiple of the original and so you know how to deal with it. |
es: @4305 |
@4320 And so, this thing ... clearly, if you substituted -- if you said "Y of N is X of (N - D)" -- in other words, you delayed it D times, all you would be doing is you would just be dividing by Z^D. |
es: @4320 |
@4335 Now, a possible misconception that you would have here is that Z isn't going to be an ordinary number like 1/2. Because of course, (1/2)^N is not a good sinusoid -- that's a dying exponential. |
es: @4335 |
@4350 A good number to raise to the Nth, to do that, would be a complex number which lives on the unit circle. So, now, I have to go back and show you complex numbers -- so that this can apply to sinusoids. So, now, we can go back. ... |
es: @4350 |
@4365 So, what I did is I sneak previewed time shifts and and phase changes to show you that I wanted to have a nice exponential sequence so that I would know what time shifts would do to it. |
es: @4365 |
51] And, I was trying to compare that with what happens if you just looked at real numbers @4380 and then you had to say cos(omega N) and then when you say cos(omega (N-D)) -- then you have to use the cosine sum-angle formula and your formulas grow much faster. |
es: @4380 |
So, you will be much happier with what it is @4395 in complex-land. ... Now, what I want to do is show you, without going into the how and the why and everything else of it: Here is what Z is, alright. So, this |
es: @4395 |
@4410 is the complex plane. The complex plane is the thing which you forgot after you got out of pre-calc. right? |
es: @4410 |
This is the real axis. This is the imaginary axis. Complex numbers @4425 in general have a real part and imaginary part which puts them somewhere on the plane because you can think of them as coordinates. And so, instead of a "number line" in real land, we have a "number plane" for the complex numbers. |
es: @4425 |
@4440 And everything that is good about the real numbers (almost) is still true about the complex numbers: You can multiply and add and all the usual good rules hold. |
es: @4440 |
1 of course has a real part of 1 @4455 and an imaginary part of 0. And in general, if you make a number which lives on the unit circle -- That is to say: The real part and imaginary part, if you add their squares up give you 1. -- |
es: @4455 |
So, that is the circle @4470 which is maybe: " A^2 + B^2 = 1 ". This is called a unit complex number and it turns out that if you take one of these unit complex numbers and square it, all you do is you get that angle further on the circle. |
es: @4470 |
@4485 So, numbers on the real line, here, if you start multiplying them, they start going in and out. Numbers that are on the unit circle in the complex plane -- if you start multiplying them, they stay on the unit circle and all you do is you change their angle. |
es: @4485 |
@4500 So, complex numbers know all about trigonometry. They just do trig for you. That's why we use them in fact -- so we don't have to do trig. |
es: @4500 |
So, in particular, if I for instance, consider the sequence @4515 1. Z, Z^2, Z^3 etc. ... -- I didn't tell you this, but actually, this angle is the same as this angle -- or this arc is the same as that arc is the same as this arc and so on. |
es: @4515 |
So, if I gave you the sequence of numbers 1, Z, Z^2 and so on, @4530 you would be going at a constant rate around the unit circle. And then, if you only looked at how that projected on the real axis, you would see a nice sinusoid. It would look like cos(omega N), |
es: @4530 |
@4545 if omega was this angle from here up to Z. That's called the "argument" of Z if you like. But, you could just call it the angle of Z. -- And that would |
es: @4545 |
@4560 be the frequency, in radians per sample, of your complex sinusoid. So, this picture says that 1, Z, Z^2, blah-blah-blah is a sinusoid which happens to have zero |
es: @4560 |
@4575 phase at the beginning of time which is here ... |
es: @4575 |
And, it also happens to have unit amplitude. And now, if you take that and multiply it by some arbitrary complex number, capital A, which is an amplitude -- @4590 It's a complex amplitude; it has not just a size but also a direction. Then you would get a sequence of numbers, A, A Z, A Z^2, ... They would be advancing at the same angle but they would have a different amplitude and |
es: @4590 |
@4605 different phase. So, these numbers here, A, A Z, A Z^2 and so on ... That is the most general form for a sinusoid. That's the output of a oscillator in general -- a sinusoidal oscillator. |
es: @4605 |
@4620 And furthermore, it has this very simple mathematical form which you can do stuff with. In particular, you can delay it -- Because delays just mean you rotate it, by some multiple times the angle omega. |
es: @4620 |
@4635 Furthermore, you can add two of them: If the frequency of the two is the same, if one of their amplitudes is A out this way and the other is an amplitude B out that way, you just add A and B as complex numbers, which is a vector sum. |
es: @4635 |
@4650 And get, and you see graphically what the amplitude and phase will be of the sum of those two sinusoids. So, that's all delay networks do. They delay things and they superpose them, which is to say they add them up. |
es: @4650 |
@4665 And you know what delays do now -- they just rotate. And you know what adding does -- it just adds, but it adds as vectors. And now now you have the tools that you need to predict the frequency response and phase response, for that matter, of any kind of delay network that |
es: @4665 |
@4680 I can throw at you. |
es: @4680 |
So that's the pep talk, which is enough for now. If there is some time, especially when we get into filters as such, I'll @4695 want to try to show you how you would translate that into like a nice bandpass filter for your synth. But it is all here basically. This is what the engineers all do when they're designing those filters, Moog, Buchla ... -- all this stuff. ... |
es: @4695 |
@4710 Yeah? |
es: @4710 |
Audience: So, with like a low pass filter. ... I don't fully understand this description, but filters that you showed us before was kind of like a notch filter, where you @4725 notch one frequency and strengthen the other one. How would a low pass filter delay be chosen ...? |
es: @4725 |
Miller: OK. So first off, @4740 it's a comb filter. So whatever you see, it repeats itself every so often depending on the period. Audience: Yeah, got it. |
es: @4740 |
Miller: The smaller the period of the delay line, @4755 the smaller the length of the delay line, the more separated those things get. Until if you make a delay line one sample, you would only get one hump and it reaches all the way from 0 to Nyquist. Audience: OK. |
es: @4755 |
Miller: And so, that is how you get its notch widths to peak. @4770 But then, how do you get to move around? And that is a little bit harder; but you just need to be able to shift and correct back the frequency. Audience: And how do you get like a low pass and a high pass? |
es: @4770 |
Miller: A low pass? Well, it's a comb filter. The comb filter had a response @4785 of 2 at DC and had a response of 0 at the first notch. So, you put that first notch at the Nyquist and it goes from |
es: @4785 |
2 at 0 -- at DC -- to 0 at the Nyquist. Then we change @4800 the recirculation to get it sharper, to push it more towards DC. |
es: @4800 |
Miller: A little hand-wavey, but that's basically what happens. And then, when you want to move the peak off of 0 -- @4815 then you have to work harder. |
es: @4815 |