Swept Monophonic Octave Generator (SMOG)?

Started by EBK, April 26, 2017, 09:16:58 PM

Previous topic - Next topic

EBK

I've had this idea kicking around in my head all day.  Perhaps it is original, perhaps not.  It borrows heavily on technology from the 1980s (I'll provide some links to great reading material later). Anyway, it is a half-baked idea at the moment, but ripe for input.

I'll blurt the following out mainly for the wise sages that grace our forum who may have done something related in the past (before FFT became easy), then I'll explain more later when I get a chance:

I'm thinking of essentially implementing an analog swept spectrum analyzer alongside a synched swept VCO that is either an octave up or octave down from the instant frequency of interest for the analyzer.  The idea is that I can use the instant analyzed frequency spectrum to adjust the instant amplitude of the VCO, which will be available to be mixed (through a pot) directly with the output.  I'm expecting that it could sound like a very drunk, perhaps stuttering, POG, but who knows....

That still sounded somewhat cryptic to me on reread, but maybe it is enough to convey the idea.
  • SUPPORTER
Technical difficulties.  Please stand by.

R.G.

Nope, not cryptic. Good idea - if you can find one of those swept instant analog spectrum analyzers. That might be quite an undertaking. There'll be some fun getting the VCO to track within musical accuracy, but the synth guys have been chasing that one for decades.

There is a little bit of a conceptual issue, in that a swept anything only has an output at the single frequency where it's sweeping at any instant, and an audio signal needs some time to get a signal out. So a truly automatically swept spectrum analyzer needs some memory of what frequency it got a signal, and a memory of that event until it gets another sweep to come by. The VCO/VCA will need to recognize the memory of an event and stick there until the sweep comes by again, and probably some logic on the instant levels' memory, so the VCO can go to the loudest (highest? lowest?) instant frequency that the analyzer picked out on its most recent sweep. Or you can have a sweep and lock, in which case you effectively have a tracking filter and a single note system, not a wholesale transposition.

The sweep rate will be one of those things that affect the musicality of the result. That and the tracking/memory of the VCO/VCA will be important.
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

EBK

#2
As promised, some background and reading material for those interested:

Raymond Quan and Rod Elliott have created a bandpass filter bank real-time audio analyzer that is quite impressive. 
http://sound.whsites.net/project136.htm
The project description also explains the justification for such an undertaking:
"Although there are many software RTAs available on the internet that have a lot more features and are much, much cheaper, I decided to build one because it's more 'fun' and you learn stuff while building." That works for me!

From that project page, I was inspired to seek out a way to do something similar, but with far fewer parts (being ok with whatever tradeoffs would come along with that goal), still keeping everything analog, and applying it to produce some interesting sounds for guitar (i.e., I'm not aiming for a lab instrument).

Further research took me on a trip backwards in time, where I learned how spectrum analysis was performed before FFT could handle it cheaply and easily.  Essentially, there were two broad categories: the filter bank (discrete) approach and the swept frequency (continuous) approach. 

Conceptually, the swept approach (there are multiple ways to implement this) involves looking at the signal's contribution at one particular frequency of interest while sweeping that frequency of interest upward until you've measured the whole frequency range, essentially producing one full trace on an oscilloscope display or the like.  The frequency of interest is then reset to the bottom of the range, and the process is repeated.

There is a very significant drawback to the swept approach in that it is only suitable for real-time analysis to the extent that your signal doesn't change rapidly.  In other words, it won't work well for audio.  But, hey, I'm interested in making noise  :icon_cool:, so maybe there is a way to still use this concept, despite its excessively slow tracking. I have some ideas that might work (I may end up filter banking the lowest frequencies and breaking the higher frequencies into multiple bands).

I found these DIY project descriptions from the early 1980s helpful:

From Ethan Winer,
http://ethanwiner.com/spectrum.html

From Peter His%^&*s (with sincere apologies to Peter for my being unable to get his last name, His[another name for rooster]s past the site content filter  :icon_redface:)
http://www.ee.ryerson.ca/~phis%^&*/papers/wireless-world-spectrum-analyser.pdf
(Fix the link to ".../~phisc,o,c,ks/papers...", without the commas.

By the way, I also looked into switched capacitor filters, but for audio those things appear to crap in their own living room, requiring clock frequencies within the audio band (typically, the clock rate required is 100 × fc).
  • SUPPORTER
Technical difficulties.  Please stand by.

EBK

#3
Quote from: R.G. on April 26, 2017, 11:22:40 PM
There is a little bit of a conceptual issue, in that a swept anything only has an output at the single frequency where it's sweeping at any instant, and an audio signal needs some time to get a signal out.
Yes, that is a bigger problem that just getting the measurements.  Haven't figured out yet what I'm planning to do for that....  Maybe a sample and hold to discretize the VCO like a pseudo filter bank.  Probably using multiple oscillators as well.
  • SUPPORTER
Technical difficulties.  Please stand by.

R.G.

I messed with filter banks at one time, looking for a good fundamental extractor circuit. The idea was to isolate the lowest actual note in a signal for further work, usually of an octave or other interval nature.

I reasoned that on a guitar, a single string note would be at worst a fundamental and a second harmonic, so filters of less than one octave wide would separate the fundamental from the second harmonic. But polyphonic music very often has an interval of a third, fourth, or fifth, and these added notes would get inside a single octave up. After a longish set of this kind of reasoning, I came up with the idea that I could extract the lowest actual frequency in a guitar sound by using either three or four filters per octave. A guitar's range is a bit over four octaves, so 12 - 16 filters would do the lowest-note fundamental extraction.

From the outputs of the filters, I reasoned that I could do an envelope detect per filter and find which filters had output, and a comparator to generate a logic signal per filter for output. After that, some simple logic could detect the lowest-frequency filter with content over the comparator threshold, then use the lowest-filter signal to gate on the VCA for that channel.

Adding on top of that with your idea of a tracking VCO, you might be able to use a PLL per filter (that sounds ominous, I know, but it's only one IC) perhaps with dividers to make octaves up/down, and perhaps thirds, fourths, and fifths from that selected note. That complexity can add an IC or two to the PLL, as in the E&MM Harmony Generator, but it also can do some fancy things that would otherwise need a DSP.

So there's some more fuel thrown onto your fire. Go light 'er up!
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

anotherjim

I may have been somewhere into this kind of thing a while ago, but maybe my purpose was different - I wanted a VCO to do a harmonic sequence. No band filtering, just letting/making a pll misbehave in the right sort of direction. We know it's a bugger to get one to follow the fundamental, they can latch on to harmonics. I figured on using that to advantage.

The pll I originally tried was an LM566. Obsolete now, though I still have some in the stash. I hope it can recreated with the 4046 instead. 566 VCO has a narrow control range compared to the CD4046. That's in the 566's favour here - though I think 4046 can have it's range reduced several ways. 566 doesn't have the much used Type2 phase comparator - it's Type1 only, a basic XOR. 4046 also has a Type1 PC, rarely seen used. Type1 PC can latch onto harmonics, but means if there is no input signal, it doesn't quickly drift to zero Hz (and silence), but towards whatever frequency 50% control volts makes the VCO run at. That means an envelope gate is needed to shut the thing up when you stop playing.

Now, without any fancy input filtering, the input was squared up and sent right into the pll. An expression pedal (could be lfo or envelope follower) is used to deliberately pull the loop filter control voltage away from where the pll is trying to put it. Result, the VCO frequency skips around, generally and momentarily finding a new harmonic.

I think that's like Eric's plan, but backwards. Not filtering out harmonics from the signal for the VCO, but tricking the pll's capture range so it only sees harmonics.

More recently I built a 4046 based guitar synth, but used Type2 phase comparator to remove the need for a VCA on output, although I did still end up fitting a mute clamp. The VCO can hunt around, but not like my original LM566 based experiment did.
...and what about using some feedback? Hmmm, I didn't think of that.
That 4046 synth was detailed here...
http://www.diystompboxes.com/smfforum/index.php?topic=113380.0
...with links to sound recordings, mostly from the dark side of the Forbidden Planet.







PRR

Take the space out of the URL below. (This forum objects to the word for a male chicken or water-tap.)
www.ee.ryerson.ca/~phisco ck/papers/wireless-world-spectrum-analyser.pdf

Or use this short URL which will redirect you (without censorship).
https://goo.gl/dxlDkU

Either way takes you to a 6MB PDF file.
  • SUPPORTER

pinkjimiphoton

Quote from: EBK on April 27, 2017, 09:23:14 AM
As promised, some background and reading material for those interested:

Raymond Quan and Rod Elliott have created a bandpass filter bank real-time audio analyzer that is quite impressive. 
http://sound.whsites.net/project136.htm
The project description also explains the justification for such an undertaking:
"Although there are many software RTAs available on the internet that have a lot more features and are much, much cheaper, I decided to build one because it's more 'fun' and you learn stuff while building." That works for me!

From that project page, I was inspired to seek out a way to do something similar, but with far fewer parts (being ok with whatever tradeoffs would come along with that goal), still keeping everything analog, and applying it to produce some interesting sounds for guitar (i.e., I'm not aiming for a lab instrument).

Further research took me on a trip backwards in time, where I learned how spectrum analysis was performed before FFT could handle it cheaply and easily.  Essentially, there were two broad categories: the filter bank (discrete) approach and the swept frequency (continuous) approach. 

Conceptually, the swept approach (there are multiple ways to implement this) involves looking at the signal's contribution at one particular frequency of interest while sweeping that frequency of interest upward until you've measured the whole frequency range, essentially producing one full trace on an oscilloscope display or the like.  The frequency of interest is then reset to the bottom of the range, and the process is repeated.

There is a very significant drawback to the swept approach in that it is only suitable for real-time analysis to the extent that your signal doesn't change rapidly.  In other words, it won't work well for audio.  But, hey, I'm interested in making noise  :icon_cool:, so maybe there is a way to still use this concept, despite its excessively slow tracking. I have some ideas that might work (I may end up filter banking the lowest frequencies and breaking the higher frequencies into multiple bands).

I found these DIY project descriptions from the early 1980s helpful:

From Ethan Winer,
http://ethanwiner.com/spectrum.html

From Peter His%^&*s (with sincere apologies to Peter for my being unable to get his last name, His[another name for rooster]s past the site content filter  :icon_redface:)
http://www.ee.ryerson.ca/~phis%^&*/papers/wireless-world-spectrum-analyser.pdf
(Fix the link to ".../~phisc,o,c,ks/papers...", without the commas.

By the way, I also looked into switched capacitor filters, but for audio those things appear to crap in their own living room, requiring clock frequencies within the audio band (typically, the clock rate required is 100 × fc).

nice, Ethan is a friend of mine. hell of a guy, too!!! he's on facebook if ya ever need to get a hold of him.

ridiculous cellist. insane guitar player... if ya look on youtube, check his cello rondo... everysound from the drums to the melody is done with his cello.

there's a video of him playing his tele with a symphony orchestra too that is pretty much plain badass.

sorry for the momentary highjack. ;)
  • SUPPORTER
"When the power of love overcomes the love of power the world will know peace."
Slava Ukraini!
"try whacking the bejesus outta it and see if it works again"....
~Jack Darr

anotherjim

I'm aware of Ethan W. His stuff on acoustics and recording have been invaluable to me. Very generous guy.


EBK

Quote from: pinkjimiphoton on April 28, 2017, 09:20:12 AM
sorry for the momentary highjack. ;)
You have my blessing to add any interesting info that you want.  :icon_wink:
  • SUPPORTER
Technical difficulties.  Please stand by.

EBK

#10
I had another thought on this theme.  What if I swept a bandpass filter and an oscillator at the filter's center frequency and mixed (multiplied) the oscillator with the filter output (and high pass filtered the result)? Could I end up with a swept octave up?
I'm thinking mixing would produce copies of the BP output at sum and difference frequencies, with the sum being double the center frequency and the difference being a baseband copy that gets filtered out.  Or, did I miss something in the time domain that foils this evil plan?

I'm imagining some serious dopplering would occur, but what else?  I'd have to account for the sweep frequency shifting everything too, I think....
  • SUPPORTER
Technical difficulties.  Please stand by.

PRR

> I'm aware of Ethan W

I learned much programming from him.
  • SUPPORTER

EBK

Just bumping this thread gently to make it more academically complete.  This application note from 1974/1989 discusses the relationship between sweep rate and resolution, among other useful things:
http://educypedia.karadimov.info/library/SpectAnalysis-AN150.pdf
  • SUPPORTER
Technical difficulties.  Please stand by.

EBK

Here's my latest conceptual:


Heterodyning with a local oscillator at the frequency of interest to shift the frequency of interest to 0.  Probably a bad idea (vague warning bells in my head are telling me that I'm forgetting something important that I learned long ago)....
  • SUPPORTER
Technical difficulties.  Please stand by.

EBK

I ordered some chips (TAPLFO 2D and VCDO1) from Tom Wiltshire (electric druid) this evening so that I can more easily set up a test bed to run some (many) proof-of-concept tests so I can first figure out what is possible, and then figure out what direction I want to take this project.  I have many ideas I want to put some effort and thought into, and none of them involve a desire to spend tons of hours trying to get a decent (but inexpensive) LFO and VCO together. :icon_wink:

I love the fact that Tom makes his PIC code freely available, which, ironically, was one of the things that inspired me to send him money.  :icon_biggrin:
  • SUPPORTER
Technical difficulties.  Please stand by.

robthequiet

Really interesting if kinda over my head, so following for educational reasons. Nenotheless, I explored pitch-to-voltage when looking into how my Roland guitar "synth" did it's pitch analysis and oscillator warp. One of the issues that occurs to me if you have a sweeping "carrier" is that your capture at f1 will depend on your sweep rate, obviously, but I'm curious to see if you get any artifacts that are as you say sum and difference or "splotchy" as a complex wave such as a guitar matches unevenly at different freqs. Would it be possible, and I ask out of not knowing, to have a counter-balancing wave that is the inverse of the carrier/sweep so that you could mix it out?

Have you looked at Haible's String Filter at all? His filter architecture is pretty cool.

EBK

#16
Quote from: robthequiet on May 17, 2017, 11:19:21 PM
Really interesting if kinda over my head, so following for educational reasons.
That's the reason I'm playing around with this idea.  It's mostly academic, but if it makes some unique sounds, even if musically atrocious, it will be worthwhile. 
QuoteNenotheless, I explored pitch-to-voltage when looking into how my Roland guitar "synth" did it's pitch analysis and oscillator warp.
Sort of a side note, but one of the interesting problems of analyzing audio is that pitch and frequency are not the same concept.  Things can get complicated very quickly when you go down the pitch detection road. 
QuoteOne of the issues that occurs to me if you have a sweeping "carrier" is that your capture at f1 will depend on your sweep rate, obviously,
Quite true.  Specifically, the faster you sweep, the wider your filter needs to be, so you trade speed for resolution.  Even with a slow sweep, there is still the problem of producing only fleeting modulated blips in the best case scenario -- still working on how to make it useful/practical
Quotebut I'm curious to see if you get any artifacts that are as you say sum and difference or "splotchy" as a complex wave such as a guitar matches unevenly at different freqs.
There is a whole army of artifacts that are marching under that "splotchy" banner here. 
One aspect that I'm very eager to explore is what I would call frequency smearing.  Imagine for a moment that the input signal is a perfectly pure sine wave at 1kHz.  The capture filter, having a certain width to it, will sweep over that signal and produce an output the entire time that its passband contains 1kHz.  Skipping ahead a few steps, the output will initially be lower than 1kHz, will ramp up to 1kHz while increasing in amplitude, then will continue ramping up in frequency while decreasing in amplitude.  Once you consider that the input signal is not a pure sine wave, you see that different frequencies will be at different parts of that rollercoaster at any particular moment.  [Edit: this is not entirely accurate....  I think that there are some quirks with spectral inversion that I haven't fully considered. At the moment, I'm confusing myself greatly by jumping between thinking in the time domain and frequency domain.  :icon_razz:]
Another problem, which I think you are hinting at, is that there may be a component of the carrier itself in the resulting product, due to mixer imbalance or other factors.
Quote
Would it be possible, and I ask out of not knowing, to have a counter-balancing wave that is the inverse of the carrier/sweep so that you could mix it out?
Ideally, the portion of the spectrum that is of interest at one moment will be separated enough from the carrier frequency that the carrier can be filtered out.  I'm anticipating tons of difficulties with low frequencies.  Right now, the greatest difficulty is keeping everything straight in my head.  The carrier frequency and the sweep frequency will each create different artifacts, some good, some harmless, some bad.

Quote
Have you looked at Haible's String Filter at all? His filter architecture is pretty cool.
Haven't looked at it yet, but I definitely will.  Thanks.
  • SUPPORTER
Technical difficulties.  Please stand by.

robthequiet

Wow, thanks for such a detailed answer. This part:

QuoteSkipping ahead a few steps, the output will initially be lower than 1kHz, will ramp up to 1kHz while increasing in amplitude, then will continue ramping up in frequency while decreasing in amplitude. 

This I can see as possibly the best part of it. With a cleaner wave I wonder what the smear would sound like. With a squarish wave you would have stronger sidebands due to intermodulation distortion, methinks.

Forgive me if I launch off a tangent here, but I imagine a second stage where you would mix in white noise that would be filtered with the product of the mix, or maybe pre-filtered, to get you some diffusion, such as what you would get on a synth with white noise going through 1V/octave filters. Just a random thought, of course.

Really looking forward to see where this goes.

Cheers, Rob

EBK

#18
Quote from: robthequiet on May 18, 2017, 11:59:19 AM
Forgive me if I launch off a tangent here, but I imagine a second stage where you would mix in white noise that would be filtered with the product of the mix, or maybe pre-filtered, to get you some diffusion, such as what you would get on a synth with white noise going through 1V/octave filters. Just a random thought, of course.
All tangents and random thoughts are welcome here.  The synth stuff is highly relevant (which helps explain why I bought 2 synth chips). 
  • SUPPORTER
Technical difficulties.  Please stand by.

EBK

  • SUPPORTER
Technical difficulties.  Please stand by.