Menu

How to do FFT between 2 nodes?

simpletk
2022-05-29
2022-05-29
  • simpletk

    simpletk - 2022-05-29

    When I use transient or FFT with single node, e.g. v(5) it works. When I print transient between 2 nodes it also work:

    * first line is ignored
    * 1V sine 100Hz
    VU1 1 0 DC 0 AC 0 0 SIN(0 1 100 0 0 0)
    * three series resistors 1k
    RR1 2 1 1000
    RR2 3 2 1000
    RR3 0 3 1000
    .options NOACCT NOPAGE
    .print tran v(2,1) v(3,0)
    .tran 0.0001 0.02 0
    .end
    

    But when I try to do FFT between two nodes:

    * first line is ignored
    * 1V sine 100Hz
    VU1 1 0 DC 0 AC 0 0 SIN(0 1 100 0 0 0)
    * three series resistors 1k
    RR1 2 1 1000
    RR2 3 2 1000
    RR3 0 3 1000
    .control
    tran 0.0001 0.02 0
    linearize  v(2,1) v(3,0)
    set specwindow=hanning
    fft v(2,1) v(3,0)
    print frequency  vdb(2,1) vdb(3,0)
    .endc
    .end
    

    It does not work. It says:

    No. of Data Rows : 208
    Error: no such vector v(2,1)
    Error: no such vector v(3,0)
    Error: no such vector 2
    Error: no such vector 1
      in term: v(2,1)
    
    Error: no such vector 3
    Error: no such vector 0
      in term: v(3,0)
    
    Error(parse.c--checkvalid): frequency: zero length vector.
    Note: No ".plot", ".print", or ".fourier" lines; no simulations run
    

    So how to do FFT when I want to measure voltage between 2 nodes, not against the ground?

     
    • marcel hendrix

      marcel hendrix - 2022-05-29

      On 2022-05-29 15:11, simpletk wrote:

      When I use transient or FFT with single node, e.g. v(5) it works. When
      I print transient between 2 nodes it also work:

      ~~~ * first line is ignored * 1V sine 100Hz
      VU1 1 0 DC 0 AC 0 0 SIN(0 1 100 0 0 0) * three series resistors 1k
      RR1 2 1 1000
      RR2 3 2 1000
      RR3 0 3 1000
      .options NOACCT NOPAGE
      .print tran v(2,1) v(3,0)
      .tran 0.0001 0.02 0
      .end
      ~~~

      But when I try to do FFT between two nodes:

      ~~~ * first line is ignored * 1V sine 100Hz
      VU1 1 0 DC 0 AC 0 0 SIN(0 1 100 0 0 0) * three series resistors 1k
      RR1 2 1 1000
      RR2 3 2 1000
      RR3 0 3 1000
      .control
      tran 0.0001 0.02 0
      linearize v(2,1) v(3,0)
      set specwindow=hanning
      fft v(2,1) v(3,0)
      print frequency vdb(2,1) vdb(3,0)
      .endc
      .end
      ~~~

      It does not work. It says:

      ~~~
      No. of Data Rows : 208
      Error: no such vector v(2,1)
      Error: no such vector v(3,0)
      Error: no such vector 2
      Error: no such vector 1
      in term: v(2,1)

      Error: no such vector 3
      Error: no such vector 0
      in term: v(3,0)

      Error(parse.c--checkvalid): frequency: zero length vector.
      Note: No ".plot", ".print", or ".fourier" lines; no simulations run
      ~~~

      So how to do FFT when I want to measure voltage between 2 nodes, not
      against the ground?

      Consult the manual for the command syntax.

      -marcel

      ~~~ * FFT test

      • 1V sine 100Hz
        VU1 1 0 DC 0 AC 0 0 SIN(0 1 100 0 0 0)

      • three series resistors 1k
        RR1 2 1 1000
        RR2 3 2 1000
        RR3 0 3 1000

      .control
      tran 0.0001 0.02 0
      display
      linearize v(2) V(1) v(3)
      display
      set specwindow=hanning
      fft v(1) v(2) v(3)
      display * print frequency vdb(2,1) vdb(3)
      .endc

      .end

       
  • simpletk

    simpletk - 2022-05-29

    It works, thanks.

     

Log in to post a comment.