Since you mentioned in another comment that your goal was to design audio plugins, perhaps consider this book by Will Pirkle. Seems to be a popular choice.
Second this ^^^^. Also highly recommend Richard Lyons' "Understanding Digital Signal Processing".
Most of the rest of this explanation relies heavily on the principle of Nyquist sampling, so if you're confused you should definitely go look it up!
Nyquist sampling (very quickly) - In a digital signal, in order to retain all the information in the signal, it has to be sampled at atleast half the highest frequency that is present in the signal.
I'm assuming you're going from a real array to a complex array. The fourier transform of a real signal is hermitian symmetric. That means that if you flip the sign on the imaginary part of the FFT component, it contains the same information as the original, i.e, it does not contain any new information about the signal.
array[0] isn't the sum of all the components, it is the zero frequency component. For example, if you have a sin wave of the form
2*sin(x) + 10
then the zero frequency component will contain 10.
However, the FFT cannot compute any frequency above the nyquist frequency. You could have a look at this for an explanation. So effectively, all points above 2 MHz in a time series sampled at 4 MHz contains no information.
I'm confused about why you have 8000 bins, when your input is only 4000 bins. Are you intentionally using any padding? As far as I'm aware, the input and output in FFTW are of the same length (for an out of place transform, that is).
This is very difficult. You'd need some sort of polyphonic source separation, which is a big active field of research and unfortunately doesn't really work all that well and the algorithms are very odd. There is one program that can sort of do this and that is Melodyne DNA.
http://www.celemony.com/en/melodyne/what-is-melodyne
If you were to do it yourself with DSP, the best starting points are sinusoidal modelling or statistical methods of separation like ICA. Most recent approaches use things like NMF (non-negative matrix factorization) or, more recently, Shift Invariant Probabilistic Latent Component Analysis. Even then, these are mostly used to do polyphonic transcription and I'm not sure how well they work for source separation as an actual goal. Melodyne's algorithm is secret but many think it might be something rather simple but effective.
There are also older ideas using instrument templates for sinusoidal modeling, so if you have a bunch of templates of a trumpet spectrum you can estimate the contributions from that instrument in the mix and reduce/remove them - again, doesn't work terribly well as far as I've seen.
This is a big field of research and, unsurprisingly, many see it as the holy grail of audio/music DSP, so there is a lot of work on it, we're just not quite there yet.
The Auto-Spectrum is the same thing as the Power Spectral Density (PSD). A good description of this equivalence is seen here.
With that in mind, the PSD describes the power of a given wavelength for the given signal.
I guess I should also mention Max (formerly called Max/MSP) - it's not free, but it's really great. PureData is actually a clone (-ish) of it, with the involvement of the original creator of Max. Max has a better user interface, but the two are functionally similar enough that you can usually follow Max tutorials for PureData (though there might be the odd thing that doesn't work the same, or objects that have a different name in Pd). The official Max tutorials are pretty good.
I 2nd that, but only if you already know Python and need more flexibility than an integrated environment. Possibly Sage would be a better fit for someone that's comfortable with MATLAB/Mathematica:
http://en.wikipedia.org/wiki/Sage_(mathematics_software)
However, Scilab has Xcos, which is a systems modeler and simulator, similar to MATLAB's Simulink:
It's similar (that's the point) but on the desktop you have a filesystem. So your input can come from a file for repeatable testing. And you have better debugging tools and no realtime constraints. Better debugging tools includes the humble printf() and ddd and ASN.
Define your datatypes with C99 stdint.h, ("int64_t" rather than "long int") to acheive greater similarity between desktop and DSP.
I don't know anything about DSP hardware, either. But I found that many people have built Raspberry Pi and Arduino-based audio devices. For instance the Mutable Instrument Shruthi is built using the same chip as Arduino. The community around these devices will also lead to instructions for building nice boxes with knobs. On the Raspberry Pi side, I found that you can run the JUCE Audio Framework on it. You may already be familiar with JUCE, but I'd like to point out that it's a very well laid out C++ library for audio and MIDI programming (among other things).
The biggest issue with these devices vs. a DSP solution is probably going to be latency. But I never actually looked into it all that much.
This is a great book on the DFT. Try to understand how the frequency resolution in the DFT is derived, and zero padding comes next.
Windowed sinc interp is one way to make a wavetable gen, sure. I believe there's a few synths out there that employ this. There are other methods that yield comparable results with less processing overhead IIRC. Mipmapping is one and a few others are fleshed out in this book:
https://www.amazon.com/Generating-Sound-Organizing-Time-Thinking-ebook/dp/B0BKYSBWL5
> "Audio Signal Processing
Late reply--I haven't been here for a few weeks. Not sure why you didn't find the course. It's at the top of the page when I search for "Audio Signal Processing":
https://www.coursera.org/course/audio
It may run again next year, but I advise that you sign on, get the videos, run thru the quizzes, whatever. You'll have a head start if you want the certificate next run.
[Understanding DSP (third edition)](https://smile.amazon.co.uk/Understanding-Digital-Signal-Processing-United/dp/0137027419) by Rick Lyons is very good and very accessible.
This is the book that got me started. When I got it in 1992 it came with a 5" floppy with the source code, I don't know how they do it in the current edition.
Multirate Signal Processing for Communication Systems by Fred Harris has useful tips for designing multirate filters, check it out.
If you want a cheap OTS solution, one of these little PWM generators might do the trick. +- 5% is practically a mile for freq stability, so I would imagine it'd probably cut it.
Man I forgot about this website. Helped to bounce Oppenheim off this website to just condense it down into something practical
https://www.amazon.com/dp/0137027419
This was also a very practical book. You can probably find the international edition on eBay for cheaper
The four multiply normalized ladder filter topology (4NL) handles time varying parameters beautifully.
It uses more CPU cycles than biquad, but it's well worth the trouble. As the name suggests it's self normalizing - state variables are normalized too. A biquad's state variables can cause instability if parameters change (a BIBO-stable biquad filter is not stable if given arbitrary state variables). There's a simple mathematical relationship between its coefficients and the desired cutoff frequency and resonance.
If you have any information about the expected characteristics of your system noise, you can leverage that to get a cleaner source to work with. I'm no Bayesian signal processing guy, but there's lots of material available on optimal signal estimation:
Optimum Array Processing pt. IV by Van Trees is the canonical text for general array processing/theory, and is what a lot of classes use/reference in graduate school. Otherwise, there are loads of domain-specifiic books (radar, comms., audio, etc.) that cover more of the application side of things.
​
I work in RF so I'm not too well versed with the audio/microphone specific books (and perhaps someone else can chime in with some recommendations there), but I'm sure a quick google/amazon search will yield something for you that's specific to microphones.
Looks like they just mix the sinewave with another 18 times the frequency. Just mix an 18x faster sinewave with the original. Pretty simple:
> normal = sin(freq * pi);
> flutter = sin(freq * pi * 18);
> output = normal + (flutter * amount);
Check out this Desmos Graph I made, and move the 'amount' slider back and forth.
So this is definitely no longer a DSP question. I would ask your questions on the Csound Mailing list. It's quite active, and they'll be able to answer your questions better than I can. There's also /r/csound, although it is quite sleepy. You can PM too, but I can't guarantee I'll give you any answers.
Seeing as you want to turn on instruments indefinitely, I suggest you look at the turnon opcode, which can be included inside the orchestra outside of instrument definitions.
Reaper has a built-in coding language called JSFX, and the download is bundled with 100's of free effects. Each effect source code (each a simple text file) can be viewed and modified in real-time.
Here is a video I made a while ago where I fresh-download Reaper and create a new JSFX in around 10 minutes (with comments).
I think the first step is to understand the FFT, what it does, and how to use it!
Must watch video about the Fourier Transform!
It took me a while to wrap my head around the FFT and use it programming, but now I've got a good understanding of how it works.
Download Reaper and behold it's vast collection of JS audio effects. The JSFX language is a sort of simplified 'C', and JSFX files are single-source file DSP effects. There's everything from filters, spectral analyzers, MIDI effects, compressors, you name it - all there for you to reverse-engineer, or copy-paste code from!
I've uploaded some data as a file here https://gofile.io/?c=bcTsTx. Its a 62MB file (because I stored it as text - sorry).
The data is stored as text - x + yi, one per line.
A frame is 1482 samples in length, and there are 1999 frames of data. Each frame has 10 samples, and the rest are zero.
The tone's frequency is +9.4248e-05 (or 3π e^(-5)), when the sample rate is 1.
If you're just starting out I'd try FlowStone http://www.dsprobotics.com/flowstone.html or if you know C++ Cockos' iPlug.
Hate to self promote, but I'm actually 70% complete writing a basic book on using those two to make audio plugs. May want to get on my mailing list if you want to get notified of when it's done.
Julia is a high-level, high-performance dynamic programming language for technical computing. It has libraries for DSP, stats, linear algebra, etc.
Acoustic fingerprinting is used to recognize a given excerpt from a larger sound recording. If this is what you want, there are plenty of scientific papers you can take a look into. However, if you are interested in identifying specific sounds (e.g., a certain speaker, a given musical instrument), then you probably need something different.
One thing I did once that may be useful for you was using Gaussian Mixture Models (GMMs) with Short Time Fourier Transforms (STFTs) to classify singing voice/musical instruments in musical excerpts. I wanted to use these models for sound source separation, but the idea is the same. This is a paper that describes a more advanced version of it: http://www.irisa.fr/metiss/ozerov/Publications/ozerov_IEEE_TASLP07.pdf.
Programming-language wise, Ruby is terrible for DSP applications. I recommend you to try Python or Julia (http://julialang.org). Julia is a new language and may not have everything you need, but if you choose to do anything similar to what I described, I believe the tools are already there (GMMs, FFTs, reading wav files, etc).
> One reply here mentioned that bias changes as a function of current meaning the state of the system can be dependant on what came before it. Wouldn't this be considered hysteresis?
I am not 100% sure whether to call it hysteresis. It's likely that it's another non-linearity. There are more non-linearities than just hysteresis ;) Non-linear modeling is truely a field on it's own and it's really hard to explain in a reddit comment. Besides that, I really don't understand a lot of the material myself.
What I would do is try to find the time domain transfer function of your system and then try to transform it to a state-space or laplace domain (laplace only works after linearisation). I don't know about how to do it for non-linear systems (I am still in grad school, but I get my non-linear courses next year).
If you really want to learn about non-linear systems, my classmates recommend this book: https://www.amazon.com/Nonlinear-Systems-3rd-Hassan-Khalil/dp/0130673897
Be prepared to do some insane math though.
> I don't understand the connection to PWM.
Frankly I don't understand that either. It could also be that the person from the image in your original post is shifting the bias voltage up/down. That way the the ratio of positive/negative voltage (also some form of duty cycle) changes.
If you push the average voltage up, you get closer and closer to the saturation point on the positive half and further away from the negative half. This leads to asymmetric distortion (distortion only on the top half and no distortion on the bottom side). If this is the case then my previous comment is nonsense and completely irrelevant to this post (oops).
It doesn't look like he is modeling a tube amplifier at all.
Will Pirkle has a brilliant book on audio dsp and plugin development. I highly recommend it
Designing Audio Effect Plugins in C++: For AAX, AU, and VST3 with DSP Theory https://www.amazon.com/dp/1138591939/ref=cm_sw_r_cp_api_glt_fabc_ETZMGBKCR24A215XHT4K?_encoding=UTF8&psc=1
Adding to the above. Will Pirkle's Designing Audio Effect Plugin in C++ book has an implementation of a stereo phaser plugin in chapter 12 together with very detailed explanation of the theory and comments in code.
I'm also assuming you're talking about pitch shifting, though in a general sense a phase vocoder does do things like pitch shifting by modifying phases of an FFT. If you're new to DSP and just looking for a project I wouldn't recommend starting with a phase vocoder unless you're pretty solid on frequency domain methods.
If you're still determined, there is a book that's got an entire chapter dedicated to the phase vocoder: Audio Effects: Theory, Implementation and Application by Reiss and McPherson. It's got source code in addition to theory, and overall I will say it's uncommonly readable and practically-minded as far as textbooks go. I honestly hate to have to recommend a $100 book, but apparently you can rent it for a month fairly cheaply if all you want is the (many) code examples.
>pure C++ knowledge
Speaking as a full-time C++ developer, Stroustrup's "The C++ Programming Language" is the holy grail, and I've been buying new editions as they're released:
https://www.amazon.com/C-Programming-Language-4th/dp/0321563840
Stroustrup is the creator of C++. Book can be a lot for beginner. Consider reading introductory section, then using remainder for reference as needed.
More introductory book by same author that I haven't read:
https://www.amazon.com/Programming-Principles-Practice-Using-2nd/dp/0321992784
If you know programming and want to learn the theory of DSP I recommend this book. It's old, but the basic principles are still the same and the C code there still compiles. There is a newer C++ version of that book, but I've never read it so I cannot tell you anything about it, but it's worth checking out.
You can make a neat reverb by using basic DSP blocks like all-pass filters and delay lines. However, if you are just beginning with DSP, I would recommend to first understand the basic theory. Some useful things to know are:
- Being able to think of a signal in terms of time and frequency (Fourier) domain, is essential because a modification in one domain will cause a modification in the other as well. This can be accomplished by learning the time and frequency representation of basic signals (sinusoids, delta function, rectangular pulse, sign function). Most other signals can be thought as in-between cases of such signals.
- Understand the function of the High-pass, Low-pass, Band-pass etc filters. A project (eg creating an equalizer) could help with getting a more hands-on experience on them.
As far as reverb goes, I am a fan of the effect. There is a lot of information online (papers, dsprelated.com) . This book has a great educational introduction to reverb algorithms and is more of a practical than a theoretical book.
Hope this helps.
The standard text book for DSP is Oppenheim & Schaeffer, but the first one I read was this one which I think is very good for the beginner.
read these pages from the beginning. this is the best introduction I've read. https://ccrma.stanford.edu/~jos/mdft/mdft.html
or buy the book which is better formatted https://www.amazon.com/dp/097456074X/ref=cm_sw_r_cp_api_E0JNzbCFC34Q1
for audio and sensor data:
for FFT stuff you probably have already read Brigham, if not do read it.
Acton has good books
https://www.amazon.com/Numerical-Methods-that-Work-Spectrum/dp/0883854503
and
https://www.amazon.com/Real-Computing-Made-Forman-Acton/dp/0691036632?ie=UTF8&ref_=asap_bc
for time-frequency look into the S-transform. It's like wavelets but it has the local phase spectrum that is consistent with the discrete fourier transform. There is also an orthonormal version of the S-transform.
This one is very good:
So is the rest of the series. It's also free online on JOS's website if you google it.
The other guys covered your specific filter question, so here's some general info on learning/implementing DSP via code. I don't know whether you're a programmer already or not, so if you're not, DSP is not a great way to learn C programming from the beginning. Basic DSP like your low-pass filter is not very demanding of more advanced programming skills, but it IS (relatively) hard to debug. I don't even want to imagine how awful debugging DSP output would be for a new programmer who's not yet sure his basic code even works properly. Much easier to learn C by writing some scrubby text output programs rather than staring at a huge pile of output floats.
If you're already comfy with C, you're just going to have to dig into some textbooks and work your way through them. Don't let them scare you. The math looks ugly, but it REALLY isn't! I highly recommend combining at least two sources for each topic.
http://www.dspguide.com/ is free and great for understanding what you're doing. Very little math, very heavy on explanations of how DSP works. Read the section on filters or whatever from this book first.
http://www.amazon.com/Audio-Programming-Book-Richard-Boulanger/dp/0262014467 is the math side of the same DSP topics + lots of actual C code implementations of each
If you make it through the pair all the way, you've pretty much got an entire foundation
I really like Will Pirkle's book Designing Audio Plugin Effects in C++, it has everything you need to know how to program effects/code+algorithm examples... Great beginner guide: http://www.amazon.com/Designing-Audio-Effect-Plug-Ins-Processing/dp/0240825152
Also recommend DAFX book, really helped me build a pitch shifter for my DSP class: http://www.amazon.com/DAFX-Digital-Udo-ouml-lzer/dp/0470665998
As far as I know, PolyBLEP is a really good way to handle discontinuities without using too much processing time, so I would stick with that.
An old professor of mine wrote this book on developing DSP plugins that has algorithms and code for pretty much anything you can think of, and I highly recommend it. It's written to go along with his software, but you can adapt the algorithms pretty easily.
http://www.amazon.com/Designing-Audio-Effect-Plug-Ins-Processing/dp/0240825152
has nothing to do with DSP since its DIGITAL signal processing.
for your google fu, use the term SDIY. plenty of resources available.
also check out music from outer space" (MFOS)
also this is supposed to be nice http://www.amazon.de/Make-Analog-Synthesizers-Ray-Wilson/dp/1449345220
Hi, thanks a lot for your help until now. I have now managed to move into the on-site interview round and would like to study the mathematical modeling aspect in a little more detail. Do you happen to know of any books for this purpose? The first book I found on Amazon is this by Frank Fahy. Is there anything else you could possibly recommend? Also, any topics other than filters, transforms and mathematical modeling that you would consider important for this role?
Thanks in advance for any help!
Hi, thanks a lot for your help until now. I have now managed to move into the on-site interview round and would like to study acoustics-related DSP in a little more detail. Do you happen to know of any books for this purpose? The first book I found on Amazon is this by Frank Fahy. Is there anything else you could possibly recommend? Also, any topics other than filters, transforms and mathematical modeling that you would consider important for this role?
Thanks in advance for any help!
the raspberry pi can be used for many audio applications, if you only pair it with a usb audio interface. for example, this one was only $8 and allowed me to get much improved audio quality out of the pi.
Buy this for .01. Great book, full solutions manual is online.
I do not know about your field, only found this :
http://noc.ac.uk/f/content/using-science/wtcnpg-11-561.pdf
to take a peek at later on. But you can't use tools like wavelets, or look for better efficiency wavelets without having an accurate overview of the whole field, reading either mallat's book, or the one afformentioned in my previous comment, or this one :
http://www.amazon.com/Wavelets-Concise-Guide-Amir-Homayoon-Najmi/dp/1421404966
in my opinion
Oppenheim and Schafer is too advanced for an intro. I would recommend Signal Processing First by McClellan, Schafer, and Yoder. It is the book I learned with in college.
http://www.amazon.com/Signal-Processing-First-James-McClellan/dp/0130909998
Terrari I didnt know what a wavelet was in december of last year. I bought myself this primer, (primers are always the best IMO), and within a month I knew all about them, implemented them in MATLAB, and impressed my boss. ;-)
If you have qs on them ask me, Ill try to help.
I really liked the The Scientist and Engineer's Guide to Digital Signal Processing for getting started. You can read the whole book online for free.
After that Fred Harris' book is excellent too. http://www.amazon.com/Multirate-Signal-Processing-Communication-Systems/dp/0131465112/ref=sr_1_2?s=books&ie=UTF8&qid=1317499091&sr=1-2