Monday, July 2, 2012

DSP - Investigations

RESEARCH

DEFINITIONS - LITE:
digital signal processor (DSP) is a specialized microprocessor with an architecture optimized for the fast operational needs of digital signal processing. --wikipedia
Digital signal processing (DSP) is the mathematical manipulation of an information signal to modify or improve it in some way. -- wikipedia
In signal processing, a filter is a device or process that removes from a signal some unwanted component or feature. --wikipedia
Fourier Transform => Say you represent an input function in terms of sine waves. The FT is like an accountant, showing how much each sine wave at frequency (whatever) contributes to the overall reproduction. --me, after looking at this ... finally... 
        Our DSP goal would be filtering. Isolate individual elements and analyze them. How do we detect those elements? Familiar filters - Low pass, Hi pass, Band filter. These determine which signals are allowed to pass though from input to output. Can elements of our input be accurately differentiated based on frequency alone? Not yet convinced...


Our input would be analog from a mic, I assume. Do/should we convert to digital? 

RESOURCES 


MIT DSP Course
  • Assumes knowledge of 
    • linear system theory for continuous-time  signals  and  systems
    • Fourier Transforms
    • Laplace Transforms

Fundamentals of Signal Analysis - GREAT resource, but I started getting too sucked in. This is a shift from the academic world. Implementation does not require 100% from scratch understanding... I always feel the drive to go that route. That's what partners are for, though - kick start reality reminders!
IDLE BRAINSTORMING:
Generally, DSP's are dedicated integrated circuits; however DSP functionality can also be produced by using field-programmable gate array chips (FPGA’s). -- wikipedia^
Hmm.... VHDL + Signal processing.... :D

We could implement a signal comparison library and implement something like Shazam (explained here, official paper here).

From my understanding, the algorithm is as follows: 
  • Find the peaks
  • Pair the peaks with a designated anchor point
  • Generate a hash using characteristics of the pair, including distance between peak and anchor
  • Query database for a series matching keys that occur with temporal locality (aka several keys appear close together)  
This algorithm is currently protected under... copyright, I suppose. Python implementations of it are not free to be published, but coders online claim to have implemented this in under two hours with 100 lines of code. 
In other words, tomorrow we ARE finishing this.

PROGRAMMING

Goal: Run THIS DEMO and understand it.
  • virtualenv sig_env
  • cd sig_env
  • pip install scikits.audiolab
  • pip install numpy
  • brew install gfortran (for scipy because I'm on lion)
  • pip install scipy
  • pip install matplotlib
(outside of sig_env)
  • sudo pip install matplotlib
  • sudo pip install scipy
  • (sudo pip install numpy? already had it)
The following line of code : 
spectrogram = specgram(sound_info, Fs = f, scale_by_freq=True,sides='default')
is responsible for generating the spectrogram.

Here is my annotated version of it: 
AS EXPLAINED TO D.PETER

smarg
anyhow, you define some delta t to look at on this graph.
(I'm actually describing the input graph. The spectrogram comes second)
[camera zooms in on only that section of the squiggly wave]
You say, "hmmmm, it sort of looks like a sin wave"
or "hmmm, it looks like sums of sine waves:
So you then take the Fourier Transform of that tiny little piece...
aka you express it in sine waves and....
hmmm how do I explain this....
It's as though the Fourier Transform is an accountant, who tallies how much each sine wave contributed to the overall result.
So if a sine wave at frequency X contributed more than a sine wave at frequency Y, X has a higher value in the Fourier Transform
Making sense?

dpeter
ha pretty nice analogy

smarg
^_^

dpeter
i still dont completely get it
but still
xD

smarg
Well for each (delta t) step you take across the original graph, you get a whole new graph telling you the most influential sine waves used to recreate that part of the original function.

dpeter
i see

smarg
it would be nice to have a 3d graph of it... the spectrogram that we were looking at showed the power for each (delta-t, frequency) pair

dpeter
the fourier transform tells you the individual sine waves?
or what

smarg
so, you know the derivative tells you about how the original function changed at that point?
The Fourier Transform tells you about how the tacky-rip-off-fake-SINE-WAVE version of the function was created.
It's not point to point specific, but... yea.
It tells you about re-creation, not change.
Maybe that wasn't a good comparison
I'm going to try making a picture.

Which you see above!
Gosh I love just copying and pasting things. And people who will just chat about awesome sciency things on their spare time! YAY!!

This was followed by a discussion about the Julia Set. Trippy and awesome... and I totally knew what it was when it came up. Thanks, reading group! 

No comments:

Post a Comment