Sallenkey band pass filter

Discussion in 'General Electronics Chat' started by Vgr039, Dec 30, 2014.

  1. Vgr039

    Thread Starter New Member

    Dec 18, 2014
    hi all, I have designed sallenkey band pass filter for 80db roll of rate and bandwidth is from 900khz t0 1Mhz but i stucked for a question in which it asks to test for a noisy signal and i dont no know how to generate noisy signal in National Instruments Multisim please let me know and thanx in advance
  2. GopherT

    AAC Fanatic!

    Nov 23, 2012
    You might get more responses if you give your post a better title. "How to simulate noises signal in MultiSim"
  3. MikeML

    AAC Fanatic!

    Oct 2, 2009
    I don't use MultiSim, but I believe it is derived from Spice. Spice and LTSpice (which is what I use) has two ways to perform noise analysis. One is a built-in type of analysis. Here is what the help file says about it:

    .NOISE -- Perform a Noise Analysis

    This is a frequency domain analysis that computes the noise due to Johnson, shot and flicker noise. The output data is noise spectral density per unit square root bandwidth.

    Syntax: .noise V(<out>[,<ref>]) <src> <oct, dec, lin> <Nsteps> <StartFreq> <EndFreq>

    V(<out>[,<ref>]) is the node at which the total output noise is calculated. It can be expressed as V(n1, n2) to represent the voltage between two nodes. <src> is the name of an independent source to which input noise is referred. <src> is the noiseless input signal. The parameters <oct, dec, lin>, <Nsteps>, <StartFreq>, and <EndFreq> define the frequency range of interest and resolution in the manner used in the .ac directive.

    Output data trace V(onoise) is the noise spectral voltage density referenced to the node(s) specified as the output in the above syntax. If the input signal is given as a voltage source, then data trace V(inoise) is the input-referred noise voltage density. If the input is specified as a current source, then the data trace inoise is the noise referred to the input current source signal. The noise contribution of each component can be plotted. These contributions are referenced to the output. You can reference them to the input by dividing by the data trace "gain".

    The waveform viewer can integrate noise over a bandwidth by <Ctrl-Key> + left mouse button clicking on the corresponding data trace label.

    The other method would be to use a Behavioral Voltage source to actually inject a time-domain noise voltage as a stimulus to a simulation.
    Here is what the Help file says about it. Pay attention to the RAND() and RANDOM() functions:

    B. Arbitrary Behavioral Voltage or Current Sources

    Symbol names: BV, BI

    Syntax: Bnnn n001 n002 V=<expression> [ic=<value>]
    + [tripdv=<value>] [tripdt=<value>]
    + [laplace=<expression> [window=<time>]
    + [nfft=<number>] [mtol=<number>]]

    Bnnn n001 n002 I=<expression> [ic=<value>]
    + [tripdv=<value>] [tripdt=<value>] [Rpar=<value>]
    + [laplace=<expression> [window=<time>]
    + [nfft=<number>] [mtol=<number>]]

    The first syntax specifies a behavioral voltage source and the next is a behavioral current source. For the current source, a parallel resistance may be specified with the Rpar instance parameter.

    Tripdv and tripdt control step rejection. If the voltage across a source changes by more than tripdv volts in tripdt seconds, that simulation time step is rejected.

    Expressions can contain the following:

    o Node voltages, e.g., V(n001)

    o Node voltage differences, e.g., V(n001, n002)

    o Circuit element currents; for example, I(S1), the current through switch S1 or Ib(Q1), the base current of Q1. However, it is assumed that the circuit element current is varying quasi-statically, that is, there is no instantaneous feedback between the current through the referenced device and the behavioral source output. Similarly, any ac component of such a device current is assumed to be zero in a small signal linear .AC analysis.

    o The keyword, "time" meaning the current time in the simulation.

    o The keyword, "pi" meaning 3.14159265358979323846.

    o The following functions:

    Function Name
    Absolute value of x
    x delayed by t. Optional max delay notification tmax.
    Real part of the arc cosine of x, e.g., acos(-5) returns 3.14159, not 3.14159+2.29243i
    Synonym for acos()
    Real part of the arc hyperbolic cosine of x, e.g., acosh(.5) returns 0, not 1.0472i
    Real part of the arc sine of x, asin(-5) is -1.57080, not -1.57080+2.29243i
    Synonym for asin()
    Arc hyperbolic sine
    Arc tangent of x
    Synonym for atan()
    Four quadrant arc tangent of y/x
    Arc hyperbolic tangent
    1 if x > .5, else 0
    Integer equal or greater than x
    Cosine of x
    Hyperbolic cosine of x
    Time derivative of x
    Same as absdelay()
    e to the x
    Integer equal to or less than x
    sqrt(x**2 + y**2)
    Integrate x, optional initial condition ic, reset if a is true.
    Integrate x, optional initial condition ic, reset on reaching modulus m, offset output by o.
    If x > .5, then y else z
    Convert x to integer
    0. if x > .5, else 1.
    Intermediate value of x, y, and z
    Natural logarithm of x
    Alternate syntax for ln()
    Base 10 logarithm
    The greater of x or y
    The smaller of x or y
    Real part of x**y, e.g., pow(-1,.5)=0, not i.
    Random number between 0 and 1 depending on the integer value of x.
    Similar to rand(), but smoothly transitions between values.
    Nearest integer to x
    Alternate syntax for idt()
    Sign of x
    Sine of x
    Hyperbolic sine of x
    Square root of x
    Interpolate a value for x based on a look up table given as a set of pairs of points.
    Tangent of x.
    Hyperbolic tangent of x
    Unit step, i.e., 1 if x > 0., else 0.
    x if x > 0., else 0.
    Random number between -.5 and .5 smoothly transitions between values even more smoothly than random().
    Alternative syntax for inv(x)
    Alternative syntax for inv(x)

    o The following operations, grouped in reverse order of precedence of evaluation:

    Convert the expressions to either side to Boolean, then AND.
    Convert the expressions to either side to Boolean, then OR.
    Convert the expressions to either side to Boolean, then XOR.
    True if expression on the left is greater than the expression on the right, otherwise false.
    True if expression on the left is less than the expression on the right, otherwise false.
    True if expression on the left is less than or equal the expression on the right, otherwise false.
    True if expression on the left is greater than or equal the expression on the right, otherwise false.
    Floating point addition
    Floating point subtraction
    Floating point multiplication
    Floating point division
    Raise left hand side to power of right hand side. Only the real part is returned, e.g., -1**1.5 gives zero not i.
    Convert the following expression to Boolean and invert.

    True is numerically equal to 1 and False is 0. Conversion to Boolean converts a value to 1 if the value is greater than 0.5, otherwise the value is converted to 0.

    Note that LTspice uses the caret character, ^, for Boolean XOR and "**" for exponentiation. Also, LTspice distinguishes between exponentiation, x**y, and the function pwr(x,y). Some 3rd party simulators have an incorrect implementation of behavioral exponentiation, evaluating -3**3 incorrectly to 27 instead of -27, presumably in the interest of avoiding the problem of exponentiating a negative number to a non-integer power. LTspice handles this issue by returning the real part of the result of the exponentiation. E.g., -2**1.5 evaluates to zero which is the real part of the correct answer of 2.82842712474619i. This means that when you import a 3rd party model that was targeted at a 3rd party simulator, you may need to translate the syntax such as x^y to x**y or even pwr(x,y).

    If an optional Laplace transform is defined, that transform is applied to the result of the behavioral current or voltage. The Laplace transform must be a function solely of s. The Boolean XOR operator, ^, is understood to mean exponentiation, **, when used in a Laplace expression. The frequency response at frequency f is found by substituting s with sqrt(-1)*2*pi*f. The time domain behavior is found from the sum of the instantaneous current(or voltage) with the convolution of the history of this current(or voltage) with the impulse response. Numerical inversion of a Laplace transfer function to the time domain impulse response is a potentially compute-bound process and a topic of current numerical research. In LTspice, the impulse response is found from the FFT of a discrete set points in frequency domain response. This process is prone to the usual artifacts of FFT's such as spectral leakage and picket fencing that is common to discrete FFT's. LTspice uses a proprietary algorithm that exploits that it has an exact analytical expression for the frequency domain response and chooses points and windows to cause such artifacts to diffract precisely to zero. However, LTspice must guess an appropriate frequency range and resolution. It is recommended that the LTspice first be allowed to make a guess at this. The length of the window and number of FFT data points used will be reported in the .log file. You can then adjust the algorithm's choices by explicitly setting nfft and window length. The reciprocal of the value of the window is the frequency resolution. The value of nfft times this resolution is the highest frequency considered. Note that the convolution of the impulse response with the behavioral source is also potentially a compute bound process.
  4. Vgr039

    Thread Starter New Member

    Dec 18, 2014
    SIR,but i want to know how to generate noisy signal in NI multisim
  5. Vgr039

    Thread Starter New Member

    Dec 18, 2014
    sorry I want to generate a noisy signal in NI multisim so tell me about that
  6. MikeML

    AAC Fanatic!

    Oct 2, 2009
    I want to hear if you can figure out how to do this in Multisim. Spice has all of the functionality I showed above. When the creators of Multisim buried Spice under their whiz-bang graphics interface, I suspect that they left out all of the stuff that Spice has known how to do since the 1980's...

    Can you tell, I am not a big fan of Multisim...
  7. MikeML

    AAC Fanatic!

    Oct 2, 2009
    Here is a filter with specs similar to yours. First I simulate it in the frequency domain to show the response:


    Nex, I simulate the time-domain output when the signal V(in) is a 2V sine-wave at the center of the bassband (~955kHz). As expected, the output is one-half the input amplitude, with no phase shift...


    Now I add a random noise source to the input waveform V(in). The amplitude is 10X greater than the real sine wave; in fact the sine wave is almost unrecognizable under the noise. The original sine wave is V(sine). Note that the filter has no trouble getting rid of all the noise, leaving only the sine wave.


    I wanted you to see how easy this was to do using a "real" analog simulator...
    Last edited: Dec 31, 2014
  8. Vgr039

    Thread Starter New Member

    Dec 18, 2014
    I had tried with this and now i have confirmed thank u and Wish a happy New Year to all
  9. atferrari

    AAC Fanatic!

    Jan 6, 2004
    In the past I wanted to have in hardware a known sine signal really "dirty" with noise and other signals. It took me too much soldering and lot of opamps.

    Now that the initial request is answered, my question, which I presume is not going to derail this thread much:

    What could be the simplest actual circuit to use if I want to repeat that test? At that time I was testing a (successful) DSP implemented with a 18F micro.
  10. MikeML

    AAC Fanatic!

    Oct 2, 2009
    One of the first hits when I Googled White Noise Generator Circuit
  11. atferrari

    AAC Fanatic!

    Jan 6, 2004
    Me too I googled once for that. Rest assured.

    I was asking for something that could be a compact circuit to contaminate badly my clear sine wave (with noise and other specific signals). Thanks anyway.
  12. MikeML

    AAC Fanatic!

    Oct 2, 2009
    Clean sine wave source, Noise generator as above, OpAmp summer is about as simple as I can come up with...
  13. atferrari

    AAC Fanatic!

    Jan 6, 2004
    Gracias for replying Mike. Yes, it's logical. Problem is I did not retain a print of the circuit (?!!) but recall the board being full of opamps. :(

    Next time I will start afresh and forget the past.

    Feliz Año Nuevo.