Page 3 of 3

Re: Schmitt trigger... Possible?

Posted: Mon Nov 07, 2016 12:01 pm
by Flavioweb
Ohhh... i see the light!
Computer data is stored on tape in a way that, for each time signal falls from a positive value to zero, the reader can reset a timer.
Time lapsed between 2 falls determine which bit is: short pulse is zero, long pulse is 1.
So, the goal is to have, for each positive values in the wave, a "max signal" that form our square wave...
I still have no idea on how to implement this... but is it!
Thanks for your advices & patience =)

Re: Schmitt trigger... Possible?

Posted: Tue Nov 08, 2016 1:01 pm
by Flavioweb
If i use this code:

Code: Select all

(setf threshold 0.08)  ;tweak this value as necessary

(let* ((sig (lowpass2 (snd-abs (highpass8 s 3000)) 3000))
       (sig (s-max (diff sig threshold) 0)))
  (clip (mult sig ny:all) 0.8))
audacity just prompt "Nyquist returned the value: 0,080000" and do nothing on signal...

Re: Schmitt trigger... Possible?

Posted: Tue Nov 08, 2016 1:14 pm
by steve
Flavioweb wrote:audacity just prompt "Nyquist returned the value: 0,080000" and do nothing on signal...
Oops, I used the 'legacy' symbol for the track audio.
Replace the "s" variable with "track*, like this:

Code: Select all

(setf threshold 0.08)  ;tweak this value as necessary

(let* ((sig (lowpass2 (snd-abs (highpass8 *track* 3000)) 3000))
       (sig (s-max (diff sig threshold) 0)))
  (clip (mult sig ny:all) 0.8))