Wednesday, January 13, 2016

Ketchup


I have to play a little catch up here. And as the great Jack Bower would say, "THERE'S NO TIME!!" So I thought it appropriate that this soundtrack be given for this post.

I had a baby girl!! That's why it's been a while. It's been the best thing to ever happen to me, and I wouldn't trade it for the world. I highly recommend it. At least, under the right circumstances.

So I'm an intern now too! I make moving things that people shoot at! That's been great.

I've also made a bit of progress on my projects, the one I'm specifically talking about here is my earbot. Mostly I've made some basic design ideas for the circuits to handle this. I want to be able to switch quite easily between finding transient sounds and taking in actual frequency content, as the end goal of this project is to be able to recognize not just the direction that the sound came from, but what object is making the sound. lofty? Yes. But that's what I want to do. So currently I have a microphone going into an amplifier going into an RC timer for transients, and then the amplifier also goes into a 10-bit ADC for some good ol fashioned DSP!

So just like the song ends abruptly, so does this blog post.

James

P.S. I will be back more often now.

Friday, April 10, 2015

This week has been...

Ugh...

I don't feel like writing too much this week.

So by the power of the internets vested in me, I say unto you...



#takingbreak #schoolishard #bebacknextweek

Friday, April 3, 2015

Earbot Design 1

This blog's soundtrack comes from the sci-fi future of TMNT turtles in time. Cowabunga dudes.



So I need to get an idea off of my chest... and even though this one may be lengthy, the best way for me to do it is to teach it.

Lately, with all of my work on neural networks and stuffs, I've thought a lot about what I can do with it.

Of course, there's a lot, but of course, I'd pick a robot.

Robots are pretty complex, so for this post I'm going to focus on the math, mostly to get it out of the way so we get get to the fun stuff.

So get out your (insert smart people stuff here) and let's build a robot!

So what I want this robot to do is turn to face noisy objects (including your self/mouth/other), and look at them curiously.

Yea, that's it. But this is a lot more complicated then it seems...

When I implement neural networks into the system, it would hopefully be able to pick out what's making the sound out of a few objects. Maybe I'll include stereoscopic vision to help it out.

But I need to have a base to build all this onto, and the base will be a simple robot that turns in a two dimensional plane to face the direction that the loudest noise it can hear is coming from.

Simply put, the base of it will be an immobile head with ears that just turns.

So how do you find the direction that a sound is coming from? Let me ask that again, how do you find the direction a sound is coming from?

It actually comes down to what's between your ears... a gap! (that's a no-brainer ha-hahahaaaaaagh...)

Sound only travels so fast, and because of the distance between your two ears, sound from an off-facing angle hits one of your ears before the other.

That amazing thing (that fills that gap between your ears) called your brain does the work of calculating the direction based on that little difference of time.

But how do we get a robot to know where a sound came from?

The only thing it will receive is sound in both ears, most likely with a short delay between the two ears. So we have a short difference in time, and the sound itself. To help keep things simple, we're going to only deal with the difference in time.

The time difference is greatest when the ears are furthest apart, meaning when they are perpendicular or at a 90 degree angle to the sound source. The difference would be essentially zero when they are are facing the direction of the sound.

Just to clarify, let's look at some directions really quick...

The direction of the ears in this case would be forward. If it helps, think of little arrows coming from your ears and pointing to whatever you're looking at (a little like this guy). These arrows, or vectors, represent the direction of facing for your ears. Similarly, the sound can also be thought of as an vector.

So now that we have some directions established, here's a trick to get a feel for what's going on...

Let's take one of the ears off of the robot.

If you were to look at the robot from above and it were spinning in circles, you'd see the one ear creating a circle with its movement.

Then look at the 'face' of the robot, your eyes level with it's ears while it's still spinning.

You'll see the ear going back and forth in an oscillatory pattern. The ear would go to one side, then the other, and back and forth etc. This is a sinusoidal motion. Yea trig!

Now that we know it's sinusoidal, we can start building a mathematical model.

Information we know:
  • The difference in time, we'll call it Dt
  • Whether it's the left or the right ear that heard the sound first. Lets call it 'side', and set it to 1 for left, -1 for right
  • The measured length between the ears, we'll just call it length
  • The speed of sound (~340m/s), we'll use the standard c (also used for speed of light, but whatever)
Information we want:
  • The angle, we'll call it theta
So with this information, we would get something that looks like this:

Dt*side = (length)*sin(theta)/c.

A little bit of algebra leads to:

arcsin(side*Dt*c/(length)) = theta

If you notice, this only gets us an angle. But is it the angle we need? Lets go back and look at what we have/need again...

What we have is an angle that represents the angle between the sound vector and the current position vector of the ears. The important factor that we introduced was that of the side. This gives us the total angle that needs to be travelled and the direction to go.

So yes! This is the angle we want.

Note that this will not be able to differentiate between sounds that come from the front of the robot and sounds that come from the back. Your brain is able to recognize the difference based on a few factors, such as other sensory cues and reverberations of the sound in the environment, but let's just keep our model simple for now.

Now that all the boring stuff is out of the way, it's time for a terrible cliffhanger!! Oh no!!

...

That's all for this post!

Thanks for reading!

#robots #engineering #maker

Saturday, February 21, 2015

Deep in the Laboratory...

Today's blog post is brought to you by: Fall Out Boy!

Just kidding. I am in no way affiliated with nor sponsored by fall out boy, or anyone quite as cool. 'cept maybe my wife... ;)

So I've been working in the lab all afternoon deriving some good ol' fashioned second order differential equations for RLC damping, and it's got me thinking... What do I want to do with this? And maybe not just this specific information, but what about my career? Is this what I really want to be doing?

I know, I know, it's normal to question where you're headed or what you might do in the future. But sometimes it just feels like you're all set and ready to go, heading the right way, and everything just kind of dies down until something just feels... off. Kinda like how when you neatly tie your shoes in the morning, and when you get home, not only are your laces loose but the tongue of your right shoe somehow made it under the ball of your foot. Weird!

That's where I am right now. And maybe all I need to do is tie my shoes again in the morning and keep going, but I can't help but ask myself if there's some way to fix it, like sowing the tongue on or tying my laces tighter. Or maybe I just need new shoes.

The last lab I worked on was building an Electromyogram circuit. It's basically a little device that you hook up to yourself and it monitors the electrical pulses from your neurons going into your muscles, and amplifies them to a readable/usable level. Pretty cool, I have to admit. Especially because I was able to get nearly 6V out of my bicep! Yea, my guns are illegal in some states...

But aside from helping to inflate my head, this circuit helped me to learn a lot about certain types of amplifiers, and even a little bit about how the body works.

So how can I use this stuff? First thought: combine it with RLC damping to create a neuromuscular powered coil gun to shoot paperclips! Nothing dangerous, of course. Hopefully just powerful enough to be annoying. (watch out spitwadders, here I come!)

Okay, no, it's probably not the most practical thing I could use this stuff for, as entertaining as it would be to launch paperclips with my brain...  But hey! You cant deny the neat-o factor.

So here's the deal. I'm doing all these cool things, and I have fun ideas with them, but I feel like it's not quite what I want to be doing. I want to design and I want to build... Mostly I want to build robots. Maybe I can work in some mechatronics classes. Or maybe I should change my major to mechanical engineering. Maybe I have the wrong idea of what being an engineer is.

Sometimes I feel like I think too much like an engineer, too analytically. I have all of these possible solutions to problems, when honestly all I need to do is step back and think about something else for a while.

I realized that what I really need is to take the time to do something else for a little bit. Stop worrying so much about the details of the minutiae, and get myself out of my own head for a bit.

I think this is really important, and healthy.

There's nothing I love more than spending time with my wife. She truly is my best friend. I also like to play guitar, or listen to music. Just something that really relaxes me and helps my mind to defragment. All I have to do is sit and play a couple of songs and... Eureka! Catharsis!

So that's what I'm learning in my lab right now. If you're feeling like something is off, and you start to question everything you're doing, it's probably time to lay off a bit and go for a walk or something. Don't say you don't have time, that's only saying that it's not a priority.

Make it a priority. It's worth it.


Thursday, February 12, 2015

The life of a huge nerd.

I've decided I'm going to put a "soundtrack" to some of my blog posts in the following manner:


You don't have to listen. In fact, I'm sure many of you may think it's quite obnoxious. But I think it makes my blog more exciting, so DEAL WITH IT. jk whatev. But if you do listen, I recommend headphones because this song has really great stereo effects in it. So cool!

I'm a nerd.

I may not play a lot of video games any more, but I sure played them a lot when I was younger. As you can probably tell, I still get into the music now and then. Which I think is fine. I love pretty much all music. Music can bring dull things to life. It can draw emotions and feelings out of you, and dramatically affect your well being. Music also gives you the ability to multi-task. You can be entertained and get dozens of other things done, all at the same time! All for only $19.99!!

Anyway, back to nerdness...

I don't know if video games are what makes me a nerd. I mean, there are other things that contribute quite significantly to my nerd-dom. Some of which are: I have an insatiable desire to take things apart and use them for something else, my near obsession with robots, and when I have time, I like to play a little game called Warhammer 40,000. (There's a whole lot of nerdery going on in that video. You have been warned.) Do I have time to play right now?? Heck no. I spend all of my time doing other nerdy things like solving stuff like this:


Or this:


These sort of thing takes a long time to work out...

So I'm a nerd. And I love it. 

I recently started something that I really enjoy: Nerd Fitness. I'm really not in bad physical shape, but I've never been in great physical shape. My cousin posted this article, and it really got me thinking about where I want to be in the future and how much I've thought about how it would be skraight up awesome to be in fantastic shape. That article was the bait to get me hooked, for sure. I've read almost all of their posts and started their workouts. Great stuff. If you're a nerd, and even if you aren't, I'm shamelessly throwing in a plug for these guys. Go check it out, because unlike most fitness articles or websites, Nerd Fitness articles actually make sense. They also focus a lot on changing your life and living to the fullest, not just fitness. Plus all of the diagrams are made of legos and action figures and stuff. Win!

Anyway, thanks for reading another short blog post. Hope you enjoyed it!


Saturday, February 7, 2015

It's-a me! :D

Hi!

Many people seem to want to get to know me (or maybe I just like to think so), so I figured that since I tend to be a little shy, I'd start something that people can read about me. So, this blog is about me.

So as an introduction, I'm an electrical engineer (hence the name of the blog), or at least an aspiring one.

I was raised in a musical home, where I spent my time imagining, playing, getting excited about taking things apart (and even more excited when I could get them back together and not get in trouble), and playing way too many video games. I served a mission for the LDS church, and when I returned, I finally decided to learn about music, hoping to learn more about myself in the meantime.

I learned a lot, both about music and me. I would never take back that time, but I started to realize that I probably couldn't make the living that I wanted out of music, and went to what I've always been good at: Engineering.

I eventually got married to the most wonderful girl in the world, and now I'm studying electrical engineering at the University of Utah, and I love it. And by it, I mean my life.

To skip the long stories, and get to the good stuff, here's a list of things that I love:

  • Building things
  • Fixing things
  • Coming up with creative solutions to problems
  • Playing guitar
  • Panda bears
  • Singing
  • 3d printers
  • Hobby R/C
  • Peanut butter
  • Being a nerd
  • My wife
  • Making my wife smile
  • Tater tots
  • Robots

There's a lot of things you may find in this blog, for instance, I may post quotes, pictures, videos, memes, or just something that happens to be on my mind at the time, or I may post some random acts of nerdery, or something about projects I'm working on... so pretty much just my life.

So that's all for today!

I know it's short, but to help you feel better, here's a video of a sneezing baby panda.

Thanks for reading!