Teensy Audio Library Design Tool 101

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
good morning just want to spend some time talking about the dttp jrc audio library design tool as you can see here and that's the link there it's it's a tool that's used to I get to understand how the library works and the various components and then how to set those various components up within the Arduino integrated development environment to then to later the teensy so what I thought I would do is very quickly is to make up a simple arrangement like this and and these blocks here comes left hand side so if you go to the the partner st. input you'll see there's an IC to here so I'll just simply drag that on and it knocked double clicked it and then I can call the name so in this particular case I'd called one or more unity and called line in selector at the age of nine nine and save to elect okay so that's hatred though is if you don't like it just check it between it's gone so what I've done there up on the input one I've grabbed line in from output I've grabbed one called so here and I've just double clicked it and called it line out this switch one here is actually a mixer and and I think I mentioned in a previous video that mixer is not in the context of an an artery makes a wii u multiplied to a God's play as an adder you look on the right-hand side any one of these boxes will these objects if you click on the right hand side here be able to see various parameters so this particular case if I click on that on the right hand side brings up how it works and I'll just circle here come up later on what you can then do and what's useful to this is if you is to use it as a switch so let's take a look five names of switch so I'll make that one disappear and what I'm doing here is I've got two inputs coming in and I'm going to switch which those inputs goes to the output and the way to do that as opposed to adding them together in terms of mixing them together and there's been the sense of AFL just an audio synthesizer and use it using the gain so this is in gate this is in channel with zero seven zero one two three and what you would do then in software so in the loop of the program if you would say switch dot gain 0 1 which turns it on and for the others I'd go switch gain 1 comma zero so the first one zero that's one would have a zero so it's - not if I wanted to turn this one on and that one off you know I'd go switch dot gain 0 comma 0 switch gain 1 comma 1 so that's second and you'll see that ladder on the coast so that's that's why I sort of recall this one switch and some of the other programs I've actually called it a relay and which I guess is a throwback to the the inner log receiver where you can have typically on either side of the filter relays to switch the RF around the place in this particular case of this call it switch over here is a is a filter so going to go under be fixed and then filters we've got to this particular program has a number of different types of filters that you can play around with and they work quite well this one here is it it's a bipod filter in again from the right hand side is all the various settings what I am going to use is this one called a stir filter in this particular case I've double clicked on it and I'll call it low-pass filter so that's third thought here the advantages of this particular one is is you can when you initialize it and this Patek because LPF dot begin and you'll see that later on the code you can assign it some coefficients and those coefficients have been used one being created we can create anywhere but what I have been doing and the others have been doing this is using the Iowa hills software which is quite useful and I'll show you that later on let's why I mean using this particular third filter because this one allows you to actually assign your own color fishin's to then make that thought to take on the types of characteristics you want in terms of where it is and the frequency this cutoff frequency the bandwidth etc and also in software which is quite useful especially in the transceiver where you want to turn off the receive chain and then tune on the transmit chain is on the fly you can say in this particular case isn't as into command I could say LP f dot end with null brackets and they will actually turn that into the filter off when I then turn off the transmitter after transmitting an intern receiver back on I would then have to reinitialize this one so I have to go through the process of LPF dot begin and then reassign the coefficients and again you see that in code we talked about lining so on the shield there you'll see that later on this and you can assign that to be what Danny achieve next even line in there less than there or you can sit and be the Mike and in oshawa Levine's so there's two ways of getting wheel in and then line out can be the lining outside or out of these businesses upside down it as either hit phone check to put it out here in this particular case I decided to enter si because it had been used if you wanted to do a sum a traditional superheat type receiver you could use an oscillator in that particular case you would want to use I can find it quickly the multiply so multiply is you clearly here what we would traditionally call an RF seems and mixer so here you could have an oscillator feeding into that side of the mixer mmm new line in which is RF going into here you know multiplying those together and outcomes of some a difference in the two the two primary ones then you can feed that through another filter say bandpass filter anyway so it's make that one disappear that disappear and that does fear and in the last one and you'll see the code for that last one is the shield's you need this one this is this sets up all the essentially it enables the whole shield so you need to have one of those obvious is sitting me it doesn't have an input doesn't have an output but you need to have a vehicle later on in the software you need to do things like worio shield and then in this particular case when I pulled that one out I can find that's the default name again oyoshi one is one is hot often use and you wish you see it with a lowercase a right yeah so once you sort of designed something and this particular case is sort of rudimentary signals in getting switched to a low-pass filter and out you can then export so by clicking kicks port it will actually create view the code that you've been sucking through the Arduino so like I say down here it's already highlighted for you to control C and then you could paste that into the integrated development environment for usually no I'm using the built in Windows 10 screen capture software here so I can't actually switch to the other program but if I was to pay them the program it would look like that so this is a fresh what I'd know causes a sketch that's using as the source this exported code coming from this program here so it looks like this I tend to get rid of these comments here because these these are XY coordinates of what created us and I don't if you find that very useful so I get rid of those and interesting enough sometimes and here's an example here when it when it created the code for that audio shield which is vet deer it didn't actually copy across the name I assigned it as little to beat both men and sometimes you'll fund some of these may not have taken bond yet to go through one is an example I didn't call it fear one my cordis low-pass filter so you just got so watch it and double check that actually the names that you wanted it it come through so that's the rule code you don't actually need its deal serial flesh best to exit a speech habits on the the device you can leave those out and all still compile quite heavily and if I now clean this up I'll show a second lot of code because we need to set up the coefficients to put into the low pass filter and that's what would typically look like here so I'm using at the basis exactly what was created and in this particular case of let those and they're just just for completeness like this and we'll just walk through again at the top and the the libraries that maybe need to be sucked in as part of the new library she's no different via early up we're going to define the coefficients for that low pass filter so here commented out are the raw coefficients that come from the Iowa hills software and I might do another video on that wide which ended a while back and when you clicked a new export on that program the coefficients it creates this very simple list of coefficients you now need to turn that into a form it is suitable to be sucked into so to speak the low-pass filter now I go back to the design tool run one here and I took on the low-pass filter it talks about that over here to the array and then further down what it needs to have is headed in this case you know needs to be short if you want to say memory then you make it a Const so what actually looks like in the end is this so you need to turn these into integers so first it it suffice to say grab this and it make it look like this so the first part is Ritchie defining an array there's 10 elements long because I've created and it's in the Iowa software team coefficients and this arrays it's going to be called just the sake of it low pass filter underscore coefficients and then and I go so I take these more numbers here i preload them with short due to CSX eight times that number finish off by brightness Colin do that all the way through if the last element and any requires it doesn't require a comma and then close it off so this is that is now an array of 10 elements made up of these coefficients tuned into the short images so once you've done that will done under setup we'll talk about that so so stepping through the code nearly all you need to instantiate the various objects so this particular case natural control heal itself def N one here I'm just calling audio shield which is quite a common name that people use bet sine wave oscillator is called ask Taurus oscillator the input which is called line then the audio mixer we called switch pet pet filter with call it low-pass filters these are objects that you need to create within this C++ the object orientated code in any upper cooling line out audio connections is the wiring this is how essentially these wires here including wire connections may come from outputs to inputs so and they have a unique number definitely one two three four five could be why you 10 20 30 40 50 sometimes goes go in fives which allows me then to insert insert connections as the programs with grows and changes they do say in the audio library it's good to in terms of the sequence to start with what's coming in versus what's going out so that's in that particular case I would have moved this line here to the first one because logically it's lining but either way it's still going to compile so you can see here that line in its output is going to switch to zero and the oscillators output zero is going to switch number one this exact and that output this one the zero and that's one which is left and right the channels is going to input a 0 and the output of oscillator which is only zero does any one output goes to the second input and anon would say it output the switch is kind of a possibility the output low power sources going to line out left and that same output is going to line out right so just sort of paralleled up and left and right channel going out in under the set up part of the code you need to these objects that you create it you need to essentially and give them characteristics and end and basically set up set them up audio memory if you go back to the audio library Mississippi a pjr c1 and all your connections that talks about memory allocation and blocks even between say 1216 seems to be okay for this type of program but you can read up more here and so you need to enable the shield set the first thing up so with your shield dot enables it's now turned it on audio shield so that's what we call that V remembers object it controls the air shield input is we have input line then and if you have crept on and line in on the right hand side last throw one of these and shows you what the options are but much indifference one saying it you can also pull line in you can set levels and in this particular case I don't see people 5 again if you go back to the tool that shows you what those levels are I'm going to feed the audio going out of this I'm going to figure out the headphones I need to unmute the different and then the internal amplifier the feed set here phones our output digital into an amplifier just into one and so it's a slightly another between 0 & 1 1 0 and this is the tricky right not a tricky one this is the important one here this is where we now begin our low pass filter so L plus low pass for the doc begin and in terms of the coefficients we go back to here low-pass filter you'll note it was looking for an array so we did the low power slaughter doc begin the array in the link it's exactly what you've seen here low pass filter dr. Ginn the array is the array that we created up here so low-pass filter coefficients so they go that there and the length as pin we have now created and initialized a low-pass filter using those coefficients and you'll note that this manipulation of the audio shield is bounded by audio no drops and then audio interrupts and again because they're the library itself it talks about tuning of interrupts while you manipulate various things and it's then it's essentially up and running in the main program itself so runtimes another program that's up and running you can do various things and down here I've got commented out but you can do things like turning off on the sly various filters we talked before about tuning of the receive chain when you do that by low Pascal cannot end again bounded by no drops men tune for us back on again and then you wanted to turn it back on again for example for you you've gone back to receive that you'd need to repeat this line here in front I'm in it back down here's something within your code okay so that's that thing teaming teaming that's quite a long video so I apologize for this pattern I guess that's of a quick 101 on how to use this tool here how to create some code how to then manipulate that code into into the integrated development environmental you know we occurred for eared we know and once you sort get used to this you don't actually use as export function all you do yeah I want to use a particular device like a a by quad filter you bring it out highlighters in industry that over here okay radio so here idea for I got an option for set low-power Saudi and we got to call it a shot keep on elegy you know I thought there so in your sake ago filter dot set low pass any stage you want at what frequency so I wouldn't export I will just know that that's how I would use that and up in here they're as close as we are using a few times at Eastern you might get enough in here and please let you know if that was useful and if you want to see something similar on the iowa Houle's software now but the sort of video capturing softly assorted outers as rich produces a much and get a quality then trying to use the caught on camera but I'll knock off here and thanks for watching and like I say if I useful you know otherwise happy tinkering you are thank you
Info
Channel: Charlie Morris
Views: 5,792
Rating: 4.949367 out of 5
Keywords: Teensy, SDR, DSP, Deign Tool, FIR, Filter, PJRC
Id: uf0KLkB93eY
Channel Id: undefined
Length: 19min 34sec (1174 seconds)
Published: Sat Jul 15 2017
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.