Older blog entries for Chicago (starting at number 138)

Arduino as Digital Filter… Hopes downed, and then Revived


I had hoped in my previous post to sample the audio through the use of an analogue input pin on the Arduino, then do some bit manipulation in the form of a Digital filter before playing back. However, my hopes have been crushed with this system:

To test the feasability of this, the code was simple - define an int to store a sample in, call analogRead() to read a byte in, convert this value into a value suitable for the number of output pins, then pass it out.

AnalogRead reads in a value between 0 and 1024, which is a 10 bit number. Because I’ve only got a 6bit DAC, I decided to just take the top 6 bits (I should really try this again with scaling as opposed to just taking MSB).

Now, since starting to write this and battling with lots of media upload tools AND wordpress.com etc, I’ve realised two things. 1) I’m not actually taking the top 6 bits, I’m using the top 2 bits because of a stupidity. and 2) I should use Scaling instead of just using the top 6 bits. I have just tried it again using 6 bits and there is a large improvement, as for scaling, that will have to wait.

My code (which is BAD and WRONG):
void loop() {
  buffer = analogRead(analogPin);
  PORTD = (byte) buffer >> 4 ; // only use MSB 6 bits
}

The following is an MP3 hosted on SplashCast Here. The first sample is the sample I’m inputting into the arduino, the second and third is the output.

Syndicated 2008-08-28 22:35:53 from Holding the Soldering Iron by the Cold End

Arduino Audio Filter


Whats the difference between Noise Makers and Audio Filters - well, I would expect a level of control. A Noise Maker implies a lack of control - the difference between “din” and “music”. I’ll start this post off with this image, which is a Waterfall image. Waterfalls are spectrum over time - In this case, the frequency is up the side, and the time is across the bottom. The intensity of the colour indicates a voltage at that particular frequency.

Waterfall of Arduino Noise Maker

Waterfall of Arduino Noise Maker

What we are seeing is how the frequencies are changing over time when the dials on the board are swizzled, and by comparing this with other audio projects, we are able to see how various features and code changes change the output.

The next stage of the project is Filters - Filters are basically devices which limit frequencies that go through them - there are essentially two types of filters, High pass (which allow high frequencies to go through) and Low Pass (which allow low frequencies through). By combining these together, you can generate Band Pass filters and Notch Filters (although you might make notch filters in a different way).

By adding filters together, you can make filters which let multiple bands (a comb shape) or ban multiple bands. If you have control of your filters, you can change them and manipulate them over time, and apparently, if you generate white noise on one side, and use two bandpass filters, you can make sounds which sound like words - by moving the two filters in and out and widen and narrow.

Anyways, when I was at Uni, I learnt how to build Digital Filters, that is I learnt the electronics behind the DSP, and its quite simple - well, its a little tricky to get them efficient, but a problem that’s been solved time and time again. The system works by multiplying a set of samples in a fashion. Unfortuantly, my choice of modules (50% electronics or low level computing, 25% maths, and about 20% computing theory) means that… I didn’t do the Signals and Systems module because my Maths skills are troubled. I loose the decimal place ok?

So I’ve had a crash course in Fourier Transforms, which are the very basics behind working out the numbers that you need in the sample multipliers… Which is what I’m about to build on this new circuit. So far, I have an analog input (which is my sampling system) and an 6 Bit R2R DAC shield. The first test will be to act as a buffer. The second will to act as an Echo Box, and the third, to Filter.

Syndicated 2008-08-27 22:42:03 from Holding the Soldering Iron by the Cold End

Arduino Noise Maker


I’m so sorry that this blog does seem to be jumping around quite a bit at the moment - one moment its RFID / NFC reading and writing, the second its serial to eithernet connections, and the third its … digital synthesizers? And unfortunatly, this post will be soon followed by a post about IRC robots, when will the random jumble of stuff come together? Soon! Sooon I say SOOOON!

Basically David Reynolds and myself have been working on a Digital Synth on the Arduino board, and been set back by being unable to get components from local shops blah blah etc etc. But finally, tonight, we have had success in building a semi-clone of the Arduino Noise Maker, and this is where I post my Vimeo Video.

Before I do, I need to first apologise to anyone reading this on Advogato - last time I posted a Vimeo video, Advogato went mental and merged my post with the person who posted immediatly before (i.e. the post immediatly below mine). The RSS feed that wordpress generates does seem to be sane and ok, so it makes me wonder if its and Advogato RSS eating/spittingout bug?

First running complete circuit - similar to that of Little - scale on Blog Spot. I should also mention that the film was filmed by Dave on a camera phone, so apologies for the sound and video quality. I think you can also hear the Wii Brain Teaser in the back ground.

This is actually the second version because we had massive problems sourcing the components needed, and we tried using a second Arduino board to clone the missing chips.

In this one however, the main noise is being outputted to the Breadboard via 6 lines into a 6 bit R2R DAC. The schmitt triggers are mounted on a nuelectronics arduino board, which controls the vibrato and the wave selector units. The two extra pots on the breadboard are the pitch and speed selection pots.

Stay tuned for more - next version promises to have some midi integration!

Info:
* R2R info: en.wikipedia.org/wiki/Resistor_Ladder
* Original Design: little-scale.blogspot.com/2008/01/arduino-noise-maker-info.html

Syndicated 2008-08-24 00:46:04 from Holding the Soldering Iron by the Cold End

Lantronix Xport Direct … and its death


Lantronix make some awesome little chips which give you a serial connection to a TCP/IP connection… that is by sending “C” followed by an IP, then waiting for a “C” back, it connects to the remote host.

My Problem? When I started with my chip, there was a wiring accident and I think I’ve fried its serial connection. So I need to buy another chip to confirm whether its dead, and then, when I have, throw this one in the bin :(.

Syndicated 2008-08-16 18:54:45 from Holding the Soldering Iron by the Cold End

Media Bashing - Electronic Passports, and why should we care?


Todays link that popped up - and I don’t search for these , I just notice them on the tech feed of Google, is Guardian talking about how easy it is to clone an electronic passport (full link here and also the Times Online) and throughout the day popping up on other sources. The story is always basically the same - given a new passport, this guy has managed to create a “copy” of the passport but edited some of the data on the clone - to be precise he’s swapped the digital image of the person (and he’s used Osama and another terrorist to get the point across).

So what’s that these articles are getting at? Basically, this (And this applies to all smart-card technologies irrelevant of they are contactless or not) - a smart card uses a standard interface to talk over, which your reader calls function calls on the processor on the other side. Now, the functions it can call, even if they’re secret, eventually will be leaked or someone will work out how they work, and publish that info.

What happens then is this - people are able to read off the smart card a whole heap of information - for example, in a credit card, the reader is able to get the card number and the name on the card, as well as other useful information about the type of card etc - this is the whole point of the card. If it wasn’t possible to get this information off, then the card wouldn’t be any use in a merchant’s terminal - a passport which you could never get the details off, would be, well, about as useful as a brick.

The way the security often works however, is that a secret piece of data on the card is used to manipulate some other data - some transaction specific data. So the banks and the passport issuers put this secret on the card which can’t be retrieved (without going into discussions here about side channel attacks). Often this is in the form of a simple hashing algorithm. The Bank/Passport office know what this secret is, and the card does - so when the merchant (or if a passport, the border guard) passes the hash up, it can be confirmed by the computers.

So what is the media raving about? Basically, they’ve got a guy who’s created his own copy of the Passport’s chip - that is he’s taken an off the shelf chip and programmed it with a program which mimics the official program.

He’s then read a copy of the real passport, and read all the “public” data from it - that is he’s called each of the functions in turn and read back the data that the official program sends. He’s then plopped that data into his own version, and changed a bit here and there. Now, this is all very good apart from he can’t clone the secret - he can either do one of two things.

1) try and get by with the same data being returned every time (which the smart card app designers will have written guards in against hackers doing that), or

2) pick a random secret and use that to generate the data that he doesn’t know.

So what he’s done is that second one. And this (in my opinion) is what the news stories should really be focusing on:

According to the news results, whilst 44 countries have signed up to the Electronic Passport scheme, and have agreed to implement it to the same standards, only 5 of them have actually implemented the electronic checks which will confirm if the secret on the card is the correct secret. The message that being sent out by the media should not be “Can we create forged cards” - that, as always, is yes, but instead, it should be “Why haven’t the other 39 countries got their systems ready yet?”. Then the question is much simpler - “Can we spot the forged cards” - with the systems that have been specified in place, the answer will be yes.

So Smart Cards are the answer to All Security Problems. Ever.

I’m not saying that. There are a lot of situations where Smart Card security based solutions don’t quite work, for instance offline transactions where you can’t verify “on the spot” if the details inside the card are genuine. There is a lot of skill and a lot of time and effort being spent by Smart Card programmers to provide very good and very secure programs - if you create a smart card program and algorithm in an afternoon, its not going to be as secure as one that has been well researched, and analysed and so forth. But, they add an extra layer of security on top of the already difficult to forge documents.

Syndicated 2008-08-06 22:32:47 from Holding the Soldering Iron by the Cold End

Audio and the Old Man


Dave and me are trying to build an audio project, which is all about sound manipulation. Dave’s the musician of the two of us, and I know nothing about sound whatsoever. We’ve got a primitive system using a Arduino that will produce sounds out of an R2R Digital to Analog Converter, but we’ve got no real idea about generating the wave form. If only we could sample…

About ten years ago, my dad mentioned in passing a short story… Before I was born, and we’re talking about the mid 70’s here, or maybe even possibly early 70’s. Either way, the styles where much different to now. He was helping a friend of his build an Digital Audio project. Sound familiar? Time to pick the old man’s brains.

Anyways, it turns out, back in the day, they built a device which sampled audio from a microphone by converting its voltage into a number, then saving it to memory, then, synchronized, retrieving the elements from memory and playing them back. Yes yes, it’s an echo box. Primitive but worked. If his memory serves him right (and we’re talking my entire life span here, and he’s had a lot of stress in that time - he’s my Dad after all) he thinks that they only sampled at about 50 times a second. Apparently, even cooler, whilst it was a digital system, they didn’t use any form of micro controller - they did the entire lot in Digital Electronics, making the controlling circuits using just logic chips. Thats hardcore. Anyways, back to the point of this.

Why couldn’t I have worked this out? My mind is stuck in this world of high tech digital quality sampling on one side, and on the other, using really high frequencies which sampling at 50hz seriously won’t cut it but that doesn’t matter does it! Either way, I’m now set to sample data on the analog port, and then shove it out again on the R2R DAC on the other side.

Ok, time for some diagrams about what I’m talking about.

Ok that was the worlds most boring diagram, but it gets the point across I guess. Sorry about the ? with the other side of the microphone. I have no idea what this should plug into, and actually, I have very little idea where I’m going to get one from. I have a suspicion I’ll be plugging it into a computers line out or headphones port into a jack there. For those of you who don’t have a clue what a R2R Dac is, then check out this page and erm, I guess thats it for now until this has actually been built.

Syndicated 2008-08-05 21:36:56 from Holding the Soldering Iron by the Cold End

Breaking Advogato with my RSS Feed…


So I set up a wordpress account to do some blogging in with more features the Advogato - I have a need to present a slightly more formal view of what I’m doing, and as this will also be very techincal related, instead of cross posting, I thought I would set the Advogato account to synch with the WordPress.

Little did I think that it would break Advogato, and indeed, it seems to have done so - the feed being generated by wordpress has (as far as I can tell) correct formatting, but Advogato must be reformatting the sequence that causes the Vimeo video to be embedded in a bad way - it is missing a single quote on the end of its line which is causing a large chunk of HTML to be ignored by Firefox, primarily half of my post and the switch over to the start of the next one.

Is there likley to be a successful fix or am I too hopeful? Is there anything I should change about the way I add the video’s? (all I did was div align=”center” then the vimeo paste code… Gah… if only systems wern’t this easy to break in 2008…

Syndicated 2008-08-05 14:40:49 from Holding the Soldering Iron by the Cold End

Starting… NOW!


Hello, starting this new blog to talk about work that I’m doing and involved with. This is also a test for the WordPress because I’ve not ever used WordPress before (really - I used it a little bit but don’t really know). Anyways, ignorance is not an excuse, just lack of time.

In this blog I hope to talk about a lot of the things that I’m working on at work and at home, especially a bit of Arduino hackery and some micro electronics, not to mention some side projects I’m working on (namely secret plans of world domination).

Also, I’ve signed up with vimeo to help me produce a bunch of better quality videos about the stuff I’m working on, and I’ve got my hands on a couple of good quality web-cams which I can use to make some basic videos and also, timelapse videos of me making stuff. It’s very handy and might be of use when I am rushed to hospital and the Doctors say “he did what???”.

So this is a couple of hours at 1 frame every 10 seconds. Its a short introduction to me not setting fire to things. Which brings me to the title of this blog. I havn’t yet come up with a good name for it - so instead I set it to something that I need to remember. Nearly every time I do a long build, at some point I will try to pass the soldering iron from one hand to the other, and invariably do so by picking it up at the hot end with my left hand. This title, is in fact a reminder for me.

Syndicated 2008-08-04 23:22:05 from Holding the Soldering Iron by the Cold End

Maplins Dodgy Service

For an amateur micro-electrician I struggle to find the parts that I need for my electronics. Recently, Dave and myself have been working on a Digital Synth, and our abilities have been foiled by the terrible status of Maplins.

To buy over the counter parts in Norwich, we're really limited - we have two Maplins. The website says that there is a particular item, that there are 5 of them at both of the stores. When we visit the said store, they tell us the items been discontinued and there arn't any such items anywhere in the region or head office.

So now we're doing a mail delivery order from RS - 4*£0.50 items and then £5 pnp. I dont mind this - apart from if I had known on wednesday that this would be the case, we would have done all our purchases this way, and have had them all ready to go for our build session yesterday.

Not. A. Happy. Bunny. Damn you Maplins. Damn you and your stupid online stock system.

Work Demonstration Complete

My Arduino board was being used for a demonstration at work, but it enabled me to get a lot of use out of it and work bought me a couple of bits that I wanted to play with, notably a network interface and a Mifare reader module.

Anyways, its back to being used for what I want to do things with, notably robot building. However, this time I am being distracted by a different use, which is sound generation - or should I say Noise generation.

I have had my imagination sparked by the prospect of using the Arduino plus some knowledge I have gained from my ham stuff to generate a synth. It's been done before, but not by a lot of people.

There seem to be a couple of routes to go down - This page documents the different ones. The main ones seem to be this:

  1. Use the Arduino to control a synth or other noise making source.
  2. Use the Arduino *as* the synth.

I've not yet completly decided which route I'm going down, I know that the sounds generated by the first method might be... better, but I have an aweful lot to learn about generating noises...

129 older entries...

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!