On 2015-10-14 19:55, Eric Jacobsen wrote: [...]> In some cases I do wonder why the term "filter" is applied. "Filter" > tends to imply that something in the input gets passed while other > things in the input do not. Is the idea that x(t) = sgn(sin(wt)) > removes the amplitude information and lets everything else through?Uhm, my idea of "filter" is a process/device which modify the input into the output. To the extreme point that no modification is a modification (pass-thru) too. Or, the null filter, which produce a constant output, independently from the input. Particularly, zero output, i.e. ground. On the other hand, as you wrote, "filter" can be understood as "selection". That is, take something, drop something else. This implies the pass-thru, but probably not the null filter.> Terminology does seem to be a big problem in dsp. For example the > term "squaring a sin" has been used by multiple people in this thread. > Is that making a square wave out of a sine wave or is that sin^2(x)? > ;)Yeah, I realized that right now!!! :-) Very funny, I guess the "squaring of the circle" comes into play, for this mismatch... bye, -- piergiorgio
Sine to square wave conversion
Started by ●October 14, 2015
Reply by ●October 14, 20152015-10-14
Reply by ●October 14, 20152015-10-14
On 2015-10-14 19:48, gyansorova@gmail.com wrote: [...]> A zero crossing detector cannot filter when there is noise. it only converts amplitude uncertainty into phase uncertainty. ie AM to PMAnd that is a filter too. There is no need of noise for filtering... :-) bye, -- piergiorgio
Reply by ●October 14, 20152015-10-14
On Wednesday, October 14, 2015 at 2:28:36 PM UTC-4, Piergiorgio Sartor wrote:> On 2015-10-14 19:55, Eric Jacobsen wrote: > [...] > > In some cases I do wonder why the term "filter" is applied. "Filter" > > tends to imply that something in the input gets passed while other > > things in the input do not. Is the idea that x(t) = sgn(sin(wt)) > > removes the amplitude information and lets everything else through? > > Uhm, my idea of "filter" is a process/device which > modify the input into the output. > To the extreme point that no modification is a > modification (pass-thru) too. > Or, the null filter, which produce a constant output, > independently from the input. Particularly, zero > output, i.e. ground. > > On the other hand, as you wrote, "filter" can be > understood as "selection". That is, take something, > drop something else. This implies the pass-thru, > but probably not the null filter. > > > Terminology does seem to be a big problem in dsp. For example the > > term "squaring a sin" has been used by multiple people in this thread. > > Is that making a square wave out of a sine wave or is that sin^2(x)? > > ;) > > Yeah, I realized that right now!!! :-) > > Very funny, I guess the "squaring of the circle" > comes into play, for this mismatch... > > bye, > > -- > > piergiorgiowell you are right, I remember playing with photoshop and they called all sorts of weird image process "filters" and it took me a while to figure out what they were talking about. Mark
Reply by ●October 14, 20152015-10-14
>On Wednesday, October 14, 2015 at 2:28:36 PM UTC-4, Piergiorgio Sartor >wrote: >> On 2015-10-14 19:55, Eric Jacobsen wrote: >> [...] >> > In some cases I do wonder why the term "filter" is applied."Filter">> > tends to imply that something in the input gets passed while other >> > things in the input do not. Is the idea that x(t) = sgn(sin(wt)) >> > removes the amplitude information and lets everything else through? >> >> Uhm, my idea of "filter" is a process/device which >> modify the input into the output. >> To the extreme point that no modification is a >> modification (pass-thru) too. >> Or, the null filter, which produce a constant output, >> independently from the input. Particularly, zero >> output, i.e. ground. >> >> On the other hand, as you wrote, "filter" can be >> understood as "selection". That is, take something, >> drop something else. This implies the pass-thru, >> but probably not the null filter. >> >> > Terminology does seem to be a big problem in dsp. For example the >> > term "squaring a sin" has been used by multiple people in thisthread.>> > Is that making a square wave out of a sine wave or is that sin^2(x)? >> > ;) >> >> Yeah, I realized that right now!!! :-) >> >> Very funny, I guess the "squaring of the circle" >> comes into play, for this mismatch... >> >> bye, >> >> -- >> >> piergiorgio > >well you are right, > >I remember playing with photoshop and they called all sorts of weirdimage>process "filters" and it took me a while to figure out what they were >talking about. > >Marka filter is any function that modifies its input signal spectrum. (attenuate,remove,equalise...etc). If we consider anything else as filter so be it. I have seen generalisations such as a pure scaling function termed a filter even when scaling is unity. Jargon gymnastics and useless. It is like saying a woman is a man but without... Kaz --------------------------------------- Posted through http://www.DSPRelated.com
Reply by ●October 14, 20152015-10-14
On 2015-10-14 20:47, kaz wrote: [...]> a filter is any function that modifies its input signal spectrum. > (attenuate,remove,equalise...etc). If we consider anything else as filterAnything else does the same. Each time a "signal" is modified, the "spectrum" is changed. So, even the "null" filter changes the spectrum. And a median one is pretty messy. A rate limiter filter "colours" the spectrum. bye, -- piergiorgio
Reply by ●October 14, 20152015-10-14
On Wed, 14 Oct 2015 17:55:23 +0000, Eric Jacobsen wrote:> On Wed, 14 Oct 2015 19:33:21 +0200, Piergiorgio Sartor > <piergiorgio.sartor.this.should.not.be.used@nexgo.REMOVETHIS.de> wrote: > >>On 2015-10-14 19:05, Tim Wescott wrote: >>[...] >>> If we were getting drunk at a university bar I'd make a bet with you >>> that it's filtering, just for the joy of arguing. >>> >>> However, most people wouldn't call it filtering. If you're doing this >>> in >> >>Well, since most people call a "median filter" filter, I guess that the >>need of linearity in order to get the name "filter" is in the eye of the >>beholder! :-) >> >>And there are rank filters too... >> >>In general, in signal processing people seem to narrow the concept of >>filter to "linear filter. >>Nevertheless, creative image processing people use a broader concept of >>filter, including morphological filters, which are by definition >>non-linear. >>Not to mention threshold filter, bilateral filters, etc. >>Meaning, IMHO, that squaring a sin *is* a filter. >> >>bye, > > In some cases I do wonder why the term "filter" is applied. "Filter" > tends to imply that something in the input gets passed while other > things in the input do not. Is the idea that x(t) = sgn(sin(wt)) > removes the amplitude information and lets everything else through? > > Terminology does seem to be a big problem in dsp. For example the term > "squaring a sin" has been used by multiple people in this thread. > Is that making a square wave out of a sine wave or is that sin^2(x)? ;)I use "squaring up" for sgn(sin(x)), I would probably use "square" for (sin(x))^2. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com
Reply by ●October 14, 20152015-10-14
This reminds me of the time when I squared up my saxophone mic signal , fed this to a divide-by-2 flip-flop and then fed the output to a speaker. I was so confident in the theory that I tried it for the first time at a gig. Not my finest moment ( either musically or electrically). Bob
Reply by ●October 14, 20152015-10-14
On 10/14/15 11:08 AM, Richard Owlett wrote:> makolber@yahoo.com wrote: >> On Wednesday, October 14, 2015 at 10:26:24 AM UTC-4, Sharan123 wrote: >>> Hello All, >>> >>> I have a question on the sine wave to square wave conversion. >>> >>> As a part of an issue I am trying to solve, we are converting a sine >>> wave >>> to square wave. >>> This conversion is simple and is based on whether the amplitude at any >>> given instant is higher or lower than a given threshold value. Please >>> note >>> that the sinewave is of a single frequency. >>> >>> The question I have is, is this a high pass filter concept? >> >> NO >> >>> >>> This is what I thought at the beginning.But then a filter attenuates >>> certain frequency components and leaves rest untouched. >>> >>> In this case, there is exactly one frequency in the input and after >>> filtering, there is a square waveform. >>> We know very well that a sine wave had exactly one frequency & did not >>> have such high frequency component. >>> >> >> Squaring a sine wave is not a filter. >>this reference to "Squaring" has an ambiguity. it could be taken the wrong way. x^2 <> sgn(x)>> A filter is typically a linear process. (no new frequencies are created) >> >> Squaring a sine wave is a non linear process and would nt be called a >> filter. >> > > Look up Fourier *SERIES* in a first year college calculus textbook. > You will find that a square wave of period 1/f will have an infinite > number of odd harmonics of a sine wave of frequency f. >whether it's "acts" like a high-pass function (by bringing up the amplitudes of all them harmonics) in some sense of the word, we're not talking about some kinda hypothetical high-pass filter that is doing this. it's a wave-shaping thingie. but not x^2. could be tanh(alpha*x) with alpha>0 . or erf(alpha*x) or something like that. could be a symmetric soft clipper of some other definition. -- r b-j rbj@audioimagination.com "Imagination is more important than knowledge."
Reply by ●October 14, 20152015-10-14
On 10/14/15 2:26 PM, Piergiorgio Sartor wrote:> On 2015-10-14 19:55, Eric Jacobsen wrote: > [...] >> In some cases I do wonder why the term "filter" is applied. "Filter" >> tends to imply that something in the input gets passed while other >> things in the input do not. Is the idea that x(t) = sgn(sin(wt)) >> removes the amplitude information and lets everything else through? > > Uhm, my idea of "filter" is a process/device which > modify the input into the output. > To the extreme point that no modification is a > modification (pass-thru) too. > Or, the null filter, which produce a constant output, > independently from the input. Particularly, zero > output, i.e. ground. > > On the other hand, as you wrote, "filter" can be > understood as "selection".okay, now here is where convention of usage in practice comes into play. a "filter" as DSPers normally mean, are frequency-selection filters. they have a "frequency response" of some sort. but the term has been, IMO, misused when applied to "median filter", but i am gonna have to accept the use of the term (i know unambiguously what is meant), just as "Hanning window" (since there has never been a Mr. or Dr. Hanning it's named after). so some of us getting annoyed and curmudgeonly when oft-used terms have their meaning forcibly changed on us, but that's what language is. neologism are born and words evolve in usage and that changes their meaning. i s'pose there is some mechanical engineer that dislikes us EEs usurping the term "filter" when he thinks it's about a device that selectively removes stuff in a stream of something else and the ME might think the term for what we call a "filter" is really "Linear, Time-Invariant system".> That is, take something, > drop something else. This implies the pass-thru, > but probably not the null filter. > >> Terminology does seem to be a big problem in dsp.yup. especially audio dsp. words like: sample (single value or an instrument sound or note sample) modulate (changing parameter such as gain or changing key) compression (data compression or level compression or companding) mix or mixer (linear mixing or non-linear mixing) phase (initial t=0 phase or present instantaneous phase of wave) bandwidth (spectrum, BPF, information theory, computer instructions/sec)>> For example the >> term "squaring a sin" has been used by multiple people in this thread. >> Is that making a square wave out of a sine wave or is that sin^2(x)? >> ;)i noticed that too before getting down to this post. before today, i never heard the term "squaring a sin" to be used in this way. i posted a little earlier that "x^2 != sgn(x)" or these other approximations to sgn() like arctan(alpha*x) or tanh(alpha*x) or erf(alpha*x). that would be the type of waveshaping function we might use to nicely "square a sine wave". (also DC-blocking the input.) -- r b-j rbj@audioimagination.com "Imagination is more important than knowledge."
Reply by ●October 14, 20152015-10-14
On 10/14/15 5:43 PM, radams2000@gmail.com wrote:> This reminds me of the time when I squared up my saxophone mic signal , fed this to a divide-by-2 flip-flop and then fed the output to a speaker.an octave pedal? did you do anything scaling the output of the flip-flop? like with an envelope follower?> I was so confident in the theory that I tried it for the first time at a gig. Not my finest moment ( either musically or electrically).oooh. that's interesting. i have a different embarrassing trial (tried it during a rehearsal) thinking that we could put a resistor pad on the speaker output of the guitar amp instead of micing it. i thought fer sher it would work. (i also tried a PLL to do note-to-control-voltage conversion. can't remember the PLL chip, but it didn't work. one EE prof suggested that we modulate up the frequency so that several octaves gets squeezed to the 10% or whatever the PLL frequency lock was. that didn't work either. soon after i was coding MC6809 and forgetting how to hook up chips.) -- r b-j rbj@audioimagination.com "Imagination is more important than knowledge."






