Breaking News
Comments
antedeluvian
User Rank
Blogger
Switched Capacitor filters
antedeluvian   4/17/2014 6:39:25 PM
NO RATINGS
Max

Have you thought about switched capacitor filters instead of your linear ones. Now I have little experience in this and I fully expect to be shot down for something or other I do not know. The advantage of a switched capacitor filter is that the pass frequency/cutoff frequency is set by a clock frequency so it can be changed at a moment's notice. It may be possible (and you will need to investigate) to have one filter and clock it according to your "bins" looking at each one in turn. Processing speed would seem to play into this approach, but still..

The LMF100 from National/TI is a long established part with 2 channels, but Linear Tech and no doubt Analog Devices and others have parts and app notes.

Of course if you used a PSoC1 you could have it built into the chip.

Max The Magnificent
User Rank
Blogger
Re: Switched Capacitor filters
Max The Magnificent   4/18/2014 9:39:13 AM
NO RATINGS
@Antedelivian: Have you thought about switched capacitor filters instead of your linear ones?

I have to say that I haven't -- but that's because (like so many things) I know more about the theory than the practice.

I'm really starting to think that digital processing is the way to go, because you can do so much more manipulation of the data.

 

B.V.Rao
User Rank
Rookie
You could be better off driving the display with FPGA
B.V.Rao   4/18/2014 3:14:28 AM
NO RATINGS
I suggest using your controller to run DSP and use FPGA to drive the LEDs.  You may not need so many outputs.  all the LED strips may be daisy chained.  Few years back I made a large (16x256) mono-color matrix with a very small FPGA.  it used to display graphic data placed in block RAM by a controller.

If you could lay your hands on a old DIY audio graphic equaliser,  you may probably be able to use it for analog spectrum separation.

Max The Magnificent
User Rank
Blogger
Re: You could be better off driving the display with FPGA
Max The Magnificent   4/18/2014 9:41:15 AM
NO RATINGS
@B.V.Rao: I suggest using your controller to run DSP and use FPGA to drive the LEDs.

That's actually a very interesting idea -- the reason I opted for the Arduino MCU driving the NeoPixel LEDs is that the timing on the LEDs is somewhat sensitive and the folks at Adafruit have already done all the work for me (bless their little cotton socks :-)

betajet
User Rank
CEO
Re: You could be better off driving the display with FPGA
betajet   4/18/2014 4:48:27 PM
NO RATINGS
It might be possible to use a Cypress PSoC 5LP to do the whole job.  That chip has an ARM Cortex-M3, programmable analog with things like switched capacitor filters, DSP, and programmable digital logic for your LEDs and whatever else you need.


What I don't know is whether it has enough performance to do everything you need and how much learning curve you need to climb.  There are cheap dev boards available: the PSoC4 Pioneer Kit (US$25, including both a PSoC 5LP and a PSoC4 in case you need both) and the PSoC 5LP Schmartboard (US$35) which has more I/O and comes in a DIP with 0.1" spacing.

Max The Magnificent
User Rank
Blogger
Re: You could be better off driving the display with FPGA
Max The Magnificent   4/18/2014 4:54:36 PM
NO RATINGS
@betajet: It might be possible to use a Cypress PSoC 5LP to do the whole job...

I'll still need my Arduino for driving my Adafruit LED strips, but like I say, there are two parts to the problem -- extracting the spectrum data from the analog input stream and then displaying the info.

So -- for this first instantiation -- I've decided to use my Arduino to display the info, but the Cypress PSoC is certainly a contended for the front end signal analysis part of the picture.

gaganluthra
User Rank
Rookie
Re: You could be better off driving the display with FPGA
gaganluthra   4/18/2014 6:11:43 PM
NO RATINGS
A PSoC 5LP would be a suitable choice -

 

here's an example of how to run the popular WS2811 LEDs completely on the programmable logic hardware of the PSoC.

 

http://www.element14.com/community/thread/27131/l/psoc-4-pioneer-kit-community-project100-psoc-4-times-square-led-billboard

 

The part also has a couple different ADCs, Op-Amps and Comparators for all your analog front end design.

 

and of course, the Cortex-M3 for processing your data

Max The Magnificent
User Rank
Blogger
Re: You could be better off driving the display with FPGA
Max The Magnificent   4/19/2014 2:31:12 PM
NO RATINGS
@gaganluthra: ...here's an example of how to run the popular WS2811 LEDs completely on the programmable logic hardware of the PSoC...

I've never actually used a PSoC... but you make a compelling argument...

betajet
User Rank
CEO
Re: You could be better off driving the display with FPGA
betajet   4/19/2014 3:11:59 PM
NO RATINGS
PSoC is amazingly versatile.  I'm most familiar with the PSoC 4 and especially 5LP: those are the parts with ARM Cortex-M0/M3 CPUs.  For a quick overview of some of the things that you can do with PSoC 4/5LP, I recommend element14's 100 Projects in 100 Days.

Max The Magnificent
User Rank
Blogger
Re: You could be better off driving the display with FPGA
Max The Magnificent   4/19/2014 4:53:08 PM
NO RATINGS
@Betajet: For a quick overview of some of the things that you can do with PSoC 4/5LP, I recommend element14's...

Wonderful info -- thanks for sharing.

Max The Magnificent
User Rank
Blogger
Re: You could be better off driving the display with FPGA
Max The Magnificent   4/18/2014 9:44:03 AM
NO RATINGS
@B.V.Rao: If you could lay your hands on a old DIY audio graphic equaliser,  you may probably be able to use it for analog spectrum separation.

This is another brilliant suggestion. It struck me while I was writing this column that the control of the display and the extraction of the audio data are two completely different things -- I can happily construct the display now while pondering how to extract the audio dat ain the background. Using an old graphic equalizer to extract the data woudl certainly make my life a lot easier...

Do you happen to have an old 16-channel graphic equalizer lying around? LOL

B.V.Rao
User Rank
Rookie
Re: You could be better off driving the display with FPGA
B.V.Rao   4/18/2014 10:56:34 AM
NO RATINGS
I had one 12ch. Never could make out whether it is working. Bad ears! It made to trash can long ago.

Max The Magnificent
User Rank
Blogger
Re: You could be better off driving the display with FPGA
Max The Magnificent   4/18/2014 10:59:19 AM
NO RATINGS
@B.V.Rao: Never could make out whether it is working.

LOL That sounds like a lot of my hobby projects :-)

GSKrasle
User Rank
Freelancer
UI/Information Display
GSKrasle   4/18/2014 3:52:25 PM
NO RATINGS
Max,

I have put a lot of thought into many projects involving the display of information. In particular, I have thought about this precise one. (You're not the only one who has built such a thing!)

But first, on Getting the Data: I recommend a proper analog anti-alias filter and D-A, providing for both channels of stereo (and maybe for the other 3.1); you don't have to use more than one initially, but it's easier to have and not need than the other way 'round. The AA filter is really not a super big deal if you can sample really really fast and then apply a multi-rate ("decimation") filter (from a library: the computation has been amazingly optimized). This allows you to reduce the data-rate to something manageable on-the-fly. Then you will probably want to use a FFT (function from the same library) to get the frequency-(phase)-amplitude-time data. Anyway, with proper AA and fs, you have all the available data and what to do with it becomes a software problem only.

But what to do with the data, how to present it? First-off consider some of the diagrams you have, in particular a, c, d: Like Space Invader, the colours are fixed: you might as well use single-colour LEDs or white ones behind a striped filter: the channel, the dimension, is wasted. It is degenerate. (What a cool term!)

Roughly, you have these dimensions available to manipulate in displaying data: X, Y, R, G, B. But your data, the output of the FFT, only has these instantaneous dimensions: f, A. How to map two variables onto five? A simple bar-graph or cartesian graph gets 2 => 2, {f,A} =>{X,Y} leaving the three colours to be usefully employed other than on/off.

How about adding a dimension? Do the FFT on both stereo channels, and now you can have f, AR, AL. Assign them to X, Y as above, but now R, G can be used to distinguish AR, AL.

Add TIME: have the display fade after a pixel has been "hit": that would allow the R, G dimensions to have more than single-bit resolution!

What about the B dimension, though? Maybe it could represent the instantaneous sum of R, G, so that signals in common would be white, with the tip of the bar's R or G hue indicating the differences.... But R+G already looks yellow.... And it would be NICE if there were some conceivable way to display pure B.... Maybe a "peak" indicator of longer persistence? A "halo" over the bars? A horizontal "peak of all" indicator (but that wastes X)?

Oh, well, I have never been able to think-up a way to use a full-colour display for information derived from stereo audio without some redundancy, some degeneracy. I guess all that is left is to add some "art" just to make it look good.

My two cents!

 

GSKrasle
User Rank
Freelancer
Re: UI/Information Display
GSKrasle   4/18/2014 3:55:59 PM
NO RATINGS
And the typos are free!

Max The Magnificent
User Rank
Blogger
Re: UI/Information Display
Max The Magnificent   4/18/2014 3:58:46 PM
NO RATINGS
@GSKrasle: And the typos are free!

Happy Dance!

Max The Magnificent
User Rank
Blogger
Re: UI/Information Display
Max The Magnificent   4/18/2014 3:58:08 PM
NO RATINGS
@GSKrasle: I recommend a proper analog anti-alias filter and D-A, providing for both channels of stereo (and maybe for the other 3.1); you don't have to use more than one initially, but it's easier to have and not need than the other way 'round.

After writing my blog I started to think this way -- as you say, it's better to have both channels available if I want them later -- if I decide to then start with mono, I guess the simplest way is to just add the outputs from the D/A converters and divide the result by 2.

GSKrasle
User Rank
Freelancer
Re: UI/Information Display
GSKrasle   4/18/2014 5:07:48 PM
NO RATINGS
Or you could simply use a 0Ω to tie them together after an input resistor/filter until you decide to implement the separate channel.

As far as displays, if you were to use R, G for R, L, then you could use the full vertical range for each like fig. d, but overlap would be yellow! Cool. I did this with LM3915's back in the day.

Or how about this: FFT to only four (2n, if you please) bins, and call them Bass (B), Low-Mid (L), High-Mid (H), Treble (T) and map them to R, B, G, and (dim) white, and display a scrolling bargraph....

Or, with the previous suggestions, B could implement an oscilloscope X vs Y of the R vs L (smoothed) amplitude, superimposed on the spectrum display, with a "tail"....

Ah, I love displays. And Excel.

 

 

Max The Magnificent
User Rank
Blogger
Re: UI/Information Display
Max The Magnificent   4/18/2014 5:11:40 PM
NO RATINGS
@GSKrasle: Or how about this...

The world is indeed our lobster (or crustacean of our choice)

Watch this space for Part 4 next week...

Max The Magnificent
User Rank
Blogger
Re: UI/Information Display
Max The Magnificent   4/18/2014 4:02:15 PM
NO RATINGS
@GSKrasle: ...consider some of the diagrams you have, in particular a, c, d: Like Space Invader, the colours are fixed: you might as well use single-colour LEDs or white ones behind a striped filter: the channel, the dimension, is wasted. It is degenerate. (What a cool term!)

I know ... I know ... but I was rushed for time, and it was easy to throw these together in Visio.


My plan is to play aroudn implementing lots of differet schemes and provide the ability to switch between them -- maybe at EE Live! 2015 I will do a presentation on the various design possibilities and choices, and then show all the different types of display and get the audience to rate them -- it might be interesting to see who likes what...

Max The Magnificent
User Rank
Blogger
Re: UI/Information Display
Max The Magnificent   4/18/2014 4:08:41 PM
NO RATINGS
@GSKrasle: Roughly, you have these dimensions available to manipulate in displaying data: X, Y, R, G, B. But your data, the output of the FFT, only has these instantaneous dimensions: f, A. How to map two variables onto five?

That's the big question -- and I think that's where the fun is really going to come in. Did you see that table display (the second video) in my BADASS Display, Part 1 blog? It starts off with f,A mapped to X,Y, with f/X also mapped to different RGB values ... but if you keep watching it switches into a completely different display more in which the colors/pixels "swirl around" to the music .... I'm still trying to wrap my brain aroudn the underlying algorithm.


Also check out the third video with the trailing/falling/fading mpst-significant pixel...

Duane Benson
User Rank
Blogger
Version 2?
Duane Benson   4/19/2014 1:25:30 PM
NO RATINGS
Max - Here's something you might want to consider for the next version of your display:


Max The Magnificent
User Rank
Blogger
Re: Version 2?
Max The Magnificent   4/19/2014 2:34:34 PM
NO RATINGS
@Duane: Here's something you might want to consider for the next version of your display...

That's amazing -- fingers crossed that I don't inadvertantly get a similar effect with the one I'm currently building LOL.

 

alex_m1
User Rank
CEO
m4
alex_m1   4/19/2014 4:35:26 PM
NO RATINGS
Max , according to this:

https://www.youtube.com/watch?v=iOnGcX9Y02Q

The cortex-m4 can handle this task. Probably it's the cheapest way - outside of i/o extenders and a small analog front end if needed , you can a decent m4 for $4 or maybe less.

I believe the teensy-3 is arduino running on a cortex m4. There also a few mbed chips that run on a m4 and are similarly simple. 

Max The Magnificent
User Rank
Blogger
Re: m4
Max The Magnificent   4/19/2014 4:52:02 PM
NO RATINGS
@alex_m1: ...The cortex-m4 can handle this task...

Very interesting -- and after watching that I saw this one with an 8-bit machine running at only 8MHz...:

https://www.youtube.com/watch?v=tCmaOb-VAEo

My cup runneth over!!!

alex_m1
User Rank
CEO
Re: m4
alex_m1   4/19/2014 8:31:29 PM
NO RATINGS
@max: the 8 bit version is a great find. Those mcu's are wild bastards.

David Ashton
User Rank
Blogger
Scales
David Ashton   4/19/2014 10:55:26 PM
NO RATINGS
Max...I'm not qualified to tell you how to drive your LEDs...but I can tell you that it is usual to have logarithmic amplitude scales on these sorts of display.  The LM3915 IC was commonly used for these and it has logarithmic 3dB steps (the sister LM3914 is linear).  This will cover a wider range and require less tweaking of the input amplitude to get the display right.

It's also common to use logarithmic steps in your frequency bands, or octaves; eg you can have your filters at 20 / 40 / 80 / 160 / 320 / 640 / 1.25K / 2/5K / 5k / 10k / 20K Hz (you could probably eliminate the first and last for most audio).  These steps are a factor of 2 apart.  If you want more steps, use square root of 2 as your factor.   If you've ever seen frequency response plots of amplifiers they usually use logarithmic scales on both axes.

Max The Magnificent
User Rank
Blogger
Re: Scales
Max The Magnificent   4/21/2014 9:31:05 AM
NO RATINGS
@David: ...it is usual to have logarithmic amplitude scales on these sorts of display.... 

I must admit, that's what I was tending toward...

Alvie
User Rank
Blogger
Spectral analysis
Alvie   4/20/2014 11:52:56 AM
NO RATINGS
@Max,

I think I should have commented on your project earlier. :)

We (ZPUino team and John English from Boulder Eng.) developed an interactive image device with a few (lots!) stripes of LED a few years ago, called "SoundPuddle". It was displayed at Apogaea that same year, and has been used since then in some outdoor displays and even indoors.

http://www.soundpuddle.org/

The design applies a 1024-point FFT to the incoming signal, and maps the "perfect" frequencies (as in musical notes) to the leds, using a hue table to map amplitude of the notes into colors. All of the leds are individually mapped in memory, despite the "shifting/ripple" effect giving impression that we only set one led at a time and just shift the colours along the stripes.

The design was fully implemented in a Spartan3E-500, including CPU (ZPUino) and all HW required to drive 12 stripes simultaneously. All memory mapped, with a ROM (SPI flash) translation array for the mappings. We had not enough RAM, so we used this extra SPI ROM for the large mapping that was required. Sub-optimal, but worked great.

I have also designed a "VU-meter" like display, very similar to what you are attempting to show. I can publish some details of it if you want. The HW is the same as for the SoundPuddle, the software is indeed a bit more complex because it uses fast and slow bars to give you a "retro" effect.

I am also playing with some 32x32 RGB panels, results are very good, I will publish some videos soon.

Perhaps we can share our knowledge here, and rule the world of visual music display :)

Alvie

Max The Magnificent
User Rank
Blogger
Re: Spectral analysis
Max The Magnificent   4/21/2014 9:32:58 AM
NO RATINGS
@Alvie: We (ZPUino team and John English from Boulder Eng.) developed an interactive image device with a few (lots!) stripes of LED a few years ago, called "SoundPuddle".

I saw that a couple of years ago -- very impressive!!!

David Ashton
User Rank
Blogger
My cup runneth over....
David Ashton   4/21/2014 3:20:33 AM
NO RATINGS
@Max...a propos of absolutely nothing except your last comment, do you remember this OOOOLD song?

http://www.youtube.com/watch?v=xvaQisHV8jw

 

 

Max The Magnificent
User Rank
Blogger
Re: My cup runneth over....
Max The Magnificent   4/21/2014 9:35:14 AM
NO RATINGS
@David: ...do you remember this OOOOLD song?

I'm delighted to say that I have never heard this before (and I hope to never hear it again LOL)


keyoke
User Rank
Rookie
MSGEQ7 might be what you're after
keyoke   4/25/2014 2:43:16 PM
NO RATINGS
Hi Max,

 Have you looked at the MSGEQ7 IC? Not sure if you're familiar, but this is a 7-band graphic EQ IC and it's rediculously easy to use, only consumes 3 pins on your MCU, and only needs a couple of capacitors for supporting components! If you're looking for "peak detection" only, it might be something to consider.

  The drawback to this is, of course, is some loss in flexability (peak output only), and that the MSGEQ7 is limited to 7 frequency bands (63 Hz, 160 Hz, 400 Hz, 1 kHz, 2.5 kHz, 6.25 kHz, and 16 kHz) only. I noticed your diagrams show your display with 16 columns.. so you'd have two extra if you were displaying both channels of a stereo signal. I'm not sure how married to 16 columns you are (Maybe use the other two for an averaged volume?).

  At about $10.00 in total (assuming stero, you'd need two ICs and they're about $5 each over at SparkFun), it's a fairly affordable solution. 

  Anyway, I didn't see it mentioned yet in the comments, figured I'd point it out as a possability. 

  Looking foward to seeing how the project turns out!

 

Max The Magnificent
User Rank
Blogger
Re: MSGEQ7 might be what you're after
Max The Magnificent   4/25/2014 3:08:49 PM
NO RATINGS
@Keyoke: Have you looked at the MSGEQ7 IC? Not sure if you're familiar, but this is a 7-band graphic EQ IC and it's rediculously easy to use...

Oooh -- I do like easy to use ... as you say, I could divide the display into left and right -- and have one column for each display the averaged volume or something -- or I could display these 7 channels on vertical columns leaving blank columns in betweeen, and then interpolate between the two real columns.

The great thing about the way I'm implwementing this -- using my Arduion Mega to drive the display, and something else to do the spectrum analysis -- means I can try a variety of different solutions -- I will certainly add the MSGEQ7 IC into the mix -- thanks for the suggestion.

Max The Magnificent
User Rank
Blogger
Re: MSGEQ7 might be what you're after
Max The Magnificent   4/25/2014 3:11:04 PM
NO RATINGS
@keyoke: Looking foward to seeing how the project turns out!

Me too LOL. Also, take a look at the related blog I just posted: Linking 2 MCUs: I2C, SPI, or a Home Grown Interface?



Max The Magnificent
User Rank
Blogger
Re: MSGEQ7 might be what you're after
Max The Magnificent   4/25/2014 3:28:52 PM
NO RATINGS
@MSGEQ7: At about $10.00 in total (assuming stero, you'd need two ICs and they're about $5 each over at SparkFun), it's a fairly affordable solution.

I just ordered them -- they should be here in a few days -- apart from anything else, it will be interesting to compare the results using these as compared to something more complex (and expensive) -- a lot of the sophistication will be in my display routines -- watch this space :-)



EE Life
Frankenstein's Fix, Teardowns, Sideshows, Design Contests, Reader Content & More
Max Maxfield

Aging Brass: Cow Poop vs. Horse Doo-Doo
Max Maxfield
38 comments
As you may recall, one of the things I want to do with the brass panels I'm using in my Inamorata Prognostication Engine is to make them look really old. Since everything is being mounted ...

EDN Staff

11 Summer Vacation Spots for Engineers
EDN Staff
11 comments
This collection of places from technology history, museums, and modern marvels is a roadmap for an engineering adventure that will take you around the world. Here are just a few spots ...

Glen Chenier

Engineers Solve Analog/Digital Problem, Invent Creative Expletives
Glen Chenier
11 comments
- An analog engineer and a digital engineer join forces, use their respective skills, and pull a few bunnies out of a hat to troubleshoot a system with which they are completely ...

Larry Desjardin

Engineers Should Study Finance: 5 Reasons Why
Larry Desjardin
45 comments
I'm a big proponent of engineers learning financial basics. Why? Because engineers are making decisions all the time, in multiple ways. Having a good financial understanding guides these ...

Flash Poll
Like Us on Facebook
EE Times on Twitter
EE Times Twitter Feed

Datasheets.com Parts Search

185 million searchable parts
(please enter a part number or hit search to begin)