I want to find fundamental frequency of a periodic signal (non-sinusoidal) in certain time window using the
.meas command in LTSpice.
I was using the following code to calculate frequency (in kHz).
.meas tran T1 find time when V(OUT)=0 rise 1000
.meas tran T2 find time when V(OUT)=0 rise 1100
.meas tran Frequency param 100/(1000*(T2-T1))
This works fine for certain cases, but when I do the parametric sweep, it gives inaccurate readings because of two issues:
Here, I assume at 1000th cycle, signal reaches its measurement window (say from time=4ms) but sometimes it doesn't. Therefor, I want to specify the absolute time for the measurement. from 4ms in this case, I have added a sample voltage waveform as below (with parametric sweep)
The zoomed waveform from 4ms is
My questions is
Is it possible to specify the starting time for the above code so that it will count cycles from the specified time? ( I tried to use
to commands but failed)