Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 7 of 7

Thread: Amplitude Modulation Effect Unit Project

  1. #1
    Junior Member
    Join Date
    Mar 2018
    Posts
    2

    Amplitude Modulation Effect Unit Project

    Hi!

    First off, I'm completely new to teensy (or similar devices) and circuit design in general which may result in me asking stupid questions... but hey, I'm here to learn!
    For example, I know what a lot of components can do and how they are useful, but don't know how to hook them up in any circuit, or what resistors to use etc.

    Anyway, I'm working on a project where I need an AM effect off which I can change the waveform and speed.

    simply: Mic input --> amplitude-modulated amplification --> line output (to speaker or recording interface etc.)

    in the end it should basically be like a code-able tremolo effect of which I can change the modulation speed and waveform with knobs.


    let me first list the parts I have at the moment:
    - a Teensy 3.2
    - a header kit that I can solder on for breadboard use
    - a small amplifier board with a built-in potentiometer (a small one you have to turn with a screwdriver)
    - a breadboard and some wires to go with it
    if I need anything else I'll just have to buy it somewhere. Shouldn't be too hard!

    Now this was what I wanted to achieve practically:
    What I want to do is basically "replacing" the POT on the amplifier board with the Teensy, so that the Teensy controls the volume output of the amplifierboard instead of the POT.
    The Teensy is then supposed to modulate the volume output with an Oscillator. Ultimately I want to be able to change or morph between Waveforms (saw waves, square waves, sine waves, etc.) but that will be a coding issue for later.
    my main questions for now are:
    - If a Teensy can function as a digital potentiometer at all, or do I need a seperate digital pot chip for this?
    - If so: how and where would I hook it up to a teensy (which pins to use and how to get them to function)

    I don't know if this is too complex to ask in just one post but any help is welcome really... this is the first time I'm doing anything like this so maybe this is a little harsh for a starter project. OR maybe it's much easier than it seems to me. I really don't know haha! I'd already be really really happy if I could get a simple saw wave modulating that volume.

    I hope I was clear enough explaining what I want to accomplish. If I left out any useful information do ask!

    I hope some of you more experienced people can help me out. thanks in advance! :)

  2. #2
    Senior Member+ Theremingenieur's Avatar
    Join Date
    Feb 2014
    Location
    Colmar, France
    Posts
    2,530
    The Teensy audio shield will, in conjunction with the Teensyduino audio library, allow you to do this. There is even a GUI tool to configure the audio input, lfo, modulator, and audio output objects with a few mouse clicks. The only code you'd have to write yourself is for reading 2 potentiometers or rotary encoders to modify speed and depth of the Tremolo.

  3. #3
    Junior Member
    Join Date
    Mar 2018
    Posts
    2
    Thanks for the quick reply!
    But if I'm correct this requires the audio itself to be processed digitally, right? because in my experience this causes quite some noticable delay/latency, which is why I wanted to do it the way I described. please correct me if I'm wrong because if I am that would save me a lot of work probably

  4. #4
    Senior Member+ Theremingenieur's Avatar
    Join Date
    Feb 2014
    Location
    Colmar, France
    Posts
    2,530
    Everything depends on how things are coded. The audio library introduces by itself (due to the digital audio block size required for efficient batch operation) a latency of about 11.6 ms.

  5. #5
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,554
    The easy way involves digital processing using the audio library, as Theremingenieur described.

    Quote Originally Posted by CHN View Post
    which is why I wanted to do it the way I described.
    To accomplish that, you're going to need a special analog amplifier circuit which can be controlled by software.

    The audio shield has analog volume control. But there are some significant limitations. Software support for using the SGTL5000 in this configuration also doesn't exist in the audio library, so you'd need to dig into the SGTL5000 code to directly control some of its registers to get the all-analog path configured.

    Here's the SGTL5000 diagram from page 2 of its datasheet.

    Click image for larger version. 

Name:	sc.png 
Views:	50 
Size:	77.8 KB 
ID:	13218

    As you can see, there is an optional analog path from Line In to the headphone volume control. But it's only Line In, not from the Mic input, so you'd need an external mic preamp.

    The next limitation is the headphone analog gain. It has a pretty wide range, from -51.5dB to +12dB. But the resolution is only in 0.5 dB steps. Maybe that's ok? Or maybe you won't like your modulation waveforms being constrained to only 128 steps (7 bits)? The gain is adjusted by communicating over I2C, so you should consider the speed limitation there. It's not meant to be full audio rate.

    The other minor issue you might consider is the programmable gain only works on the headphone, not the Line Out. The headphone output uses a DC offset for the headphone ground. If you're planning to run the signal to other ground-referenced gear, you should plan on needing DC blocking capacitors.

  6. #6
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,554
    Or maybe you could find some other analog amplifier chip? But there isn't such a circuit built into Teensy, and the SGTL5000-based audio shield is the only PJRC product with anything like this. You'll need to look elsewhere if you want a more capable variable gain analog amplifier.

  7. #7
    Senior Member
    Join Date
    Nov 2012
    Location
    Boston, MA, USA
    Posts
    1,107
    Quote Originally Posted by CHN View Post
    Thanks for the quick reply!
    But if I'm correct this requires the audio itself to be processed digitally, right? because in my experience this causes quite some noticable delay/latency, which is why I wanted to do it the way I described. please correct me if I'm wrong because if I am that would save me a lot of work probably
    Doing this digitally is easy and fast. You can then see whether the performance meets your needs.

    You can also do this in the analog domain, but you will need more components. You will need a voltage controlled amplifier (VCA) such as the CoolAudio V2164 or THAT 2162. Then make read the input pots (or make a digital oscillator) which drives the built-in DAC, the voltage from which controls the gain on the VCA.

    http://www.coolaudio.com/docs/COOLAU..._DATASHEET.pdf
    http://www.thatcorp.com/2162_Dual_Pr...mplifier.shtml

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •