How to sim a tone stack in LTSpice?

Discussion in 'General Electronics Chat' started by Mike33, Dec 31, 2009.

  1. Mike33

    Thread Starter AAC Fanatic!

    Feb 4, 2005
    349
    25
    Hi,
    I need to simulate a bass, mid, treble tone stack within an amplifier using LT Spice. Wondering how best to do this since pots aren't provided.

    I see 2 ways: 1) use 2 resistors to simulate a setting of each control, which is very messy and ungainly, or 2) pop in something to act as a 'load' to drag the signal down by the expected amount (drop in dB).
    Anybody have a cure for this type of problem?

    Thanks!

    ~Mike :)
     
  2. Ron H

    AAC Fanatic!

    Apr 14, 2005
    7,050
    657
    Here's the way I do it.
    The 1 milliohm added to each leg of the pot is there so you can use 0 and 1 for the limits of k. Without the 1m, resistance would be zero at the extremes, which would generate an error message.
     
  3. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    Directly related to your question is LTSpice's ability to use .wav files for an input waveform, and write .wav files as output, something like this:

    [​IMG]

    There's documentation about these features in the Help file.

    In this simulation, I read in a noisy .wav file, ran it through a filter, and wrote 10 seconds of it to a 11.025kHz sample rate 16 bit mono .wav file. You'd want to use a higher sample rate for music; 44.1K would be good. Careful, you can wind up with HUGE output files.
     
  4. Mike33

    Thread Starter AAC Fanatic!

    Feb 4, 2005
    349
    25
    Thanks to both of you! I was thinking of how to simulate the pot sweep, and I think that makes sense, Ron. And the ability to hear something of how the tone stack would output is awesome, Sgt! But what I'm really trying to get at is - say I have 3 gain stages, 3rd being a cathode follower that drives a tone stack. I want to know how much insertion loss the thing causes, and maybe follow it with a PI and output stage. I just want to represent the tone stack as a 'black box', not for frequency response but 'power sucking'.

    The first solution would be a little bulky (having to define params for 3 pots...). My idea of splitting off the pots as 2 resistors/wiper at the junction might be the only way in LT, though. Just use a really low value at top and the majority of the pot value at the bottom to simulate a "near 10" condition to avoid having all those params...

    I can use Duncan's Tone Stack Calculator to get an idea of how many dB I'll lose in a tone stack...how then to make that "black box" of dB drop? Simple resistive voltage divider or something?
    I would simulate the ACTION of the tone stack separately when I can isolate it from the driving circuitry to keep it simple.
    Thanks again, guys! Always good input in here.
     
  5. Ron H

    AAC Fanatic!

    Apr 14, 2005
    7,050
    657
    Wy do you need to represent the tone stack as a black box attenuator? Why can't you just do an AC simulation (Bode plot) of the relevant portion of your circuit?
     
  6. Mike33

    Thread Starter AAC Fanatic!

    Feb 4, 2005
    349
    25
    Well, Ron, the way I've been doing it is to set up a simulation of say my gain stages...then a CF (or buffer) to drive a tone stack. Then do math to see what kind of losses the stack will give me...then on to the power output stage without knowing for sure what's really going to happen when I insert the real tone stack. If I wanted to run the 'whole deal' with an actual tone stack, I'd have to put 2x the resistors in the circuit bc LTspice doesn't have pots. Gets messy when you come up with something you want to print out!

    Finding the frequency response of the stack isn't an issue, it is simple to do that...it is sticking the thing into an existing amplifier schematic without pots that is bugging me!
    So, barring a way to put pots into LT, I'd like to know how to attenuate at "that point" of the amp properly. I mean, translate dB loss into -voltage, and attenuate with a resistive voltage divider, or is it more complex due to the phase shifts within a tone stack? And the fact that you'll have different gains at different freq's. That kinda thing ;)

    To put it simply, the tone stack eats some power, and I need to know how much to feed it, and what I'll get out at the other side....without over-complicating things, if possible...

    Thanks!
     
  7. Ron H

    AAC Fanatic!

    Apr 14, 2005
    7,050
    657
    I don't know enough about your problem to tell you how to solve it, but I frequently take my simulation schematic with all the extra, inconvenient resistors, convert them to pots, then save it under another file name before posting or printing. It is simple to draw a pot in LTspice. You simply place a resistor, and add the wiper with the Edit/Draw/Line (ctrl+L) command.
     
  8. Mike33

    Thread Starter AAC Fanatic!

    Feb 4, 2005
    349
    25
    That's a pretty good idea, Ron - sure would make display nicer!
    How about calling a subroutine - saving something such as a messy, functional tone stack, giving your schematic insertion points and having your analysis 'call' the sub? Then you get my desired "black box" with all its features, without cluttering up the work area?
    I know it can be done; do you have any easy ideas of how the process is implemented?
    Thanks again,

    ~Mike
     
  9. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
  10. Mike33

    Thread Starter AAC Fanatic!

    Feb 4, 2005
    349
    25
    Thank you, T06 - that's a good resource. Not sure if I can get it to do what I want with that info, but I'll try!!
     
  11. Ron H

    AAC Fanatic!

    Apr 14, 2005
    7,050
    657
    In LTspice, you can save a circuit as a subcircuit, createe a symbol for it, and insert the subcircuit in a higher level schematic. I have done it, but it was a while back. I'm on the road right now (returning from home from holiday revelries with family), so I can't provide details, but the info is in the help file.
     
  12. Mike33

    Thread Starter AAC Fanatic!

    Feb 4, 2005
    349
    25
    Good deal you can check in while on the road, lol. Happy holidays, and thanks for the pointers. It's probably not worth doing it for a tone stack, but maybe just to 'add in' the loss in dB or something. I was primarily curious, and maybe this will get me to slog along and learn the subcircuit routine!

    Drive carefully, if you're anywhere near where I am (Maine), you're probably in snow...
     
  13. Ron H

    AAC Fanatic!

    Apr 14, 2005
    7,050
    657
    Not in Maine, but I drove in snow (mostly just blowing) from Bismarck, ND to Dickinson, ND yesterday afternoon, and from Dickinson to Glendive, MT, this morning. Since then, the weather has been great (for winter). Right now I'm in a Hampton Inn in Idaho Falls, ID. I should get home (Boise) in time to watch Boise State play TCU in the Fiesta Bowl. Go Broncos!:D
     
Loading...