Schmitt trigger... Possible?
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
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
Schmitt trigger... Possible?
I'm using Audacity 2.1.2 on OpenSuSe.
I want to know if there is a way to "emulate" a Schmitt trigger...
Someone can point me in the right direction?
I want to know if there is a way to "emulate" a Schmitt trigger...
Someone can point me in the right direction?
Re: Schmitt trigger... Possible?
Audacity does not do real-time processing.
If you're not wanting this for real-time use, then please describe in detail what you are wanting to do.
If you're not wanting this for real-time use, then please describe in detail what you are wanting to do.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
Re: Schmitt trigger... Possible?
I don't want to do it in real time.
See the attachments...
I need to have bottom wave look like the top wave...
I thought to Schmitt trigger... but also other solutions are welcome.
See the attachments...
I need to have bottom wave look like the top wave...
I thought to Schmitt trigger... but also other solutions are welcome.
- Attachments
-
- Waves-01.jpg (41.59 KiB) Viewed 1289 times
Re: Schmitt trigger... Possible?
I think a gate could act as a Schmitt trigger. I'm not sure all gates are a real ST, but at least, some are.
But I'm wondering too what would be the use, as you can't get the result out of Audacity. And as Steve wrote, Audacity doesn't do real-time triggering, so the use would be even more limited.
For those not intimate with a Schmitt trigger, it's a level switch with hysteresis. And hysteresis means it'll switch from off to on at level X, but won't immediately switch off if the level dips below X again. Like most thermostats and most other automated switches operate in real life.
But I'm wondering too what would be the use, as you can't get the result out of Audacity. And as Steve wrote, Audacity doesn't do real-time triggering, so the use would be even more limited.
For those not intimate with a Schmitt trigger, it's a level switch with hysteresis. And hysteresis means it'll switch from off to on at level X, but won't immediately switch off if the level dips below X again. Like most thermostats and most other automated switches operate in real life.
Re: Schmitt trigger... Possible?
That looks more like a comparator than a Schmitt trigger (https://en.wikipedia.org/wiki/Schmitt_trigger).
I also notice that the upper waveform has a slower rise time than fall time. Is that important to the design?
It would help if you described in detail what you are wanting to do. What's the job? What's the context?
I also notice that the upper waveform has a slower rise time than fall time. Is that important to the design?
It would help if you described in detail what you are wanting to do. What's the job? What's the context?
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
Re: Schmitt trigger... Possible?
From your drawing, a limiter would be closer.
So you basically want to create a sine with flat tops?
Wouldn't a programmable signal generator program be easier?
So you basically want to create a sine with flat tops?
Wouldn't a programmable signal generator program be easier?
Re: Schmitt trigger... Possible?
And it would even be easier in hardware. Like two diodes...
Re: Schmitt trigger... Possible?
These signals come from "computer tapes".
They are analog, but I have to convert them to digital.
Square waves with, just to say, +0,5/-0,5 peaks where "sin" waves have "peaks".
More precisely, from +0.2 up i can set the "+0,5" peak, and from -0.2 down i can set the "-0,5" peak.
the "+/-0,2" value it's absolutely arbitrary...
This should make "square" a "sinus" or whatever wave...
They are analog, but I have to convert them to digital.
Square waves with, just to say, +0,5/-0,5 peaks where "sin" waves have "peaks".
More precisely, from +0.2 up i can set the "+0,5" peak, and from -0.2 down i can set the "-0,5" peak.
the "+/-0,2" value it's absolutely arbitrary...
This should make "square" a "sinus" or whatever wave...
Re: Schmitt trigger... Possible?
Out of interest I wrote a little demo. This also uses the Nyquist Prompt effect http://manual.audacityteam.org/man/nyquist_prompt.html
Firstly a "comparator".
For this we will first generate 1 second 20 Hz sine tone, amplitude 0.8:
The next bit of code reads 44100 samples from the selected track (our sine tone) and compares each sample to a value of 0.0. If the sample value is greater than 0, the output is +0.8, otherwise it is -0.8.
The outout:
But what if we have a noisy signal?
Our comparator "jitters" as the waveform crosses 0.0 multiple times due to the noise:
and a zoomed in view:
So here we need a Schmitt trigger. In this case the output goes high when the input exceeds +0.2, and stays high until the input drops below -0.2.
So now the output from our "dirty" sine wave looks like this:
Firstly a "comparator".
For this we will first generate 1 second 20 Hz sine tone, amplitude 0.8:
Code: Select all
(abs-env (mult 0.8 (hzosc 20)))Code: Select all
(setf ar (snd-fetch-array *track* 44100 44100))
(dotimes (i 44100 (snd-from-array 0 44100 ar))
(let ((input (aref ar i)))
(if (> input 0)
(setf (aref ar i) 0.8)
(setf (aref ar i) -0.8))))
But what if we have a noisy signal?
Code: Select all
(abs-env
(sum (mult (hzosc 20) 0.5)(mult (noise) 0.1)))
and a zoomed in view:
So here we need a Schmitt trigger. In this case the output goes high when the input exceeds +0.2, and stays high until the input drops below -0.2.
Code: Select all
(setf ar (snd-fetch-array *track* 44100 44100))
(setf output 0)
(dotimes (i 44100 (snd-from-array 0 44100 ar))
(let ((input (aref ar i)))
(cond
((> input 0.2) (setf output 0.8))
((< input -0.2) (setf output -0.8)))
(setf (aref ar i) output)))
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
Re: Schmitt trigger... Possible?
If the input is not too "noisy", then a simple and fairly fast way is:Flavioweb wrote:These signals come from "computer tapes".
They are analog, but I have to convert them to digital.
Square waves with, just to say, +0,5/-0,5 peaks where "sin" waves have "peaks".
More precisely, from +0.2 up i can set the "+0,5" peak, and from -0.2 down i can set the "-0,5" peak.
the "+/-0,2" value it's absolutely arbitrary...
This should make "square" a "sinus" or whatever wave...
Code: Select all
(clip (mult *track* ny:all) 0.5)If you need the hysteresis of a Schmitt trigger, then something like my previous code could work as a starting point, but that code in it's current form is only suitable for fairly short mono tracks.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)