Schmitt trigger... Possible?

Effects, Recipes, Interfacing with other software, etc.
Forum rules
If you require help using Audacity, please post on the forum board relevant to your operating system:
Windows
Mac OS X
GNU/Linux and Unix-like
Flavioweb
Posts: 22
Joined: Fri Nov 04, 2016 8:23 pm
Operating System: Linux Debian

Re: Schmitt trigger... Possible?

Post by Flavioweb » Mon Nov 07, 2016 12:01 pm

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 =)

Flavioweb
Posts: 22
Joined: Fri Nov 04, 2016 8:23 pm
Operating System: Linux Debian

Re: Schmitt trigger... Possible?

Post by Flavioweb » Tue Nov 08, 2016 1:01 pm

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...

steve
Site Admin
Posts: 81627
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Schmitt trigger... Possible?

Post by steve » Tue Nov 08, 2016 1:14 pm

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))

9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Post Reply