Go Down

### Topic: RE: Low Pass Filter (Read 7331 times)previous topic - next topic

#### Southpark

#30
##### Jun 15, 2017, 07:26 pmLast Edit: Jun 15, 2017, 10:18 pm by Southpark
It's not clear why one would make this distinction.  The time and frequency domain representations of a physical signal are mathematically equivalent.  If one is physical the other is by definition.

And, you just said it, correctly. One is physical..... the real thing, such as .... I present you with the number 3. And this is the number 3..... plain and clear. Sure, you can mathematically decompose it in various ways, like 2.9 + 0.1, or 1.5 * 2, etc. Let's just (by analogy and by example) assume that '3' is the real deal..... physical. The rest are mathematical manipulations. So, if I present to you the number 3, then it is '3'. You normally don't go around teaching people that it IS "physically" some kind of infinite series thing, unless you want to do some kind of analysis or mathematical exercise, or something.

So, mathematically equivalent... yes.... or 'can be hypothetically expressed as', or 'can be modeled as'..... all ok. No problem.

But ..... "IS physically the same as" (ie. occurring in the background IS a bunch of things going on like 0.1 + 2.8 + 0.1)  .... no. Not ok.

#### Southpark

#31
##### Jun 15, 2017, 08:44 pmLast Edit: Jun 15, 2017, 09:02 pm by Southpark
So a pure sine wave is a graphed unit circle?
The answer to that is .... no.

However, if an object is moving around a circle repeatedly, then then a plot of the vertical distance (or even the horizontal distance) versus time will have a sine-wave pattern. Another way to convey that is ..... consider a circle. A plot of the y-axis value (of a point) versus the angle of that point will result in a sine wave pattern for the plot. So, it could be considered as a plot of a value versus angle in one case. Or, if we follow an object that travels around a circle, it could be considered as a plot of a value versus time.

For constant speed (constant angular velocity) motion around a circular path...... the angle and the time are related by this formula.....   ANGLE (in radians) = w.t
'w' is 'omega'.... units of radians per second.

The above formula is under the assumption that the object's initial position on the circle (at time t = 0) is at zero degrees (or zero radians).

See this image obtained from the internet....

It means, you can model (mathematically) a sinewave by using some mathematical formulas that express  the time-changing vertical (or even horizontal) distance as a function of time. The origins of such a model is circular motion. The cyclic nature of the circular movement links nicely with the cyclic nature of the sinewave. It does not necessarily mean that any real (measured) sinewave originates from circular motion. Sometimes....maybe - such as angular measurements for a motor shaft.... but not always.

#### Southpark

#32
##### Jun 15, 2017, 10:05 pmLast Edit: Jun 15, 2017, 10:13 pm by Southpark
Jase.... for this PWM generator, what kind of input are you putting into this PWM generator? For example, do you just set an input value every once in a while, so that the pulse width of the signal remains the same for a relatively long time?

Or, are you changing the pulse widths of the PWM waveform at some relatively fast rate?

In any case, it sounds like it will be much better for you to go for a much higher PWM frequency. With higher PWM frequency (relative to 490 Hz), it can be more convenient to design an RC filter that gives you desirable results that you (or we) want. Desirable results mean ..... output DC voltage is relatively clean.... relatively low ripple. And also means - the response time is relatively quick --- like doesn't take forever for the output to reach the new DC value after you change the input.

#### Southpark

#33
##### Jun 15, 2017, 11:32 pmLast Edit: Jun 15, 2017, 11:38 pm by Southpark
The DC component is the average of the duty cycle? I'm still having trouble understanding why then we set our cut-off frequency to 0Hz? Don't we need the voltage to toggle between 0V and 5V in order to achieve PWM?
You don't need to set any cutoff frequency to 0 Hz.

The DC component is sometimes called 'average DC value'). If the voltage is finite, and never changes.... eg. 2 Volt..... then the average of this value over time is 2 Volt.

For some kind of periodic signal (where you know its period), a maths formula can be applied .... a 'time average formula'. This formula 'averages' the signal over 1 full cycle of the waveform. The result will be a value. And that value will be the 'DC average'.

For a PWM signal, with 2 levels of voltage..... eg, 0 V and 2 V......  if you have 50 percent duty cycle, the DC average will be half-way between those two levels.... which is 1 Volt., or 0.5 times 2V.

If you have 20 percent duty cycle, then the DC average will be 0.2 times 2V, which is 0.4 Volt.

And, suppose that the PWM waveform has levels of 0 V and 1 V instead. No problem.... the same rule applies.... 50 percent duty cycle would translate to a DC average value of 0.5 times 1V, which is 0.5 Volt.

And..... for 100 percent duty cycle.... we'd get 1 times 1V, which gives 1 Volt. 100 percent duty cycle means that the PWM signal is just a horizontal line, with a value of 1 Volt.

#### allanhurst

#34
##### Jun 16, 2017, 12:03 am
Do we dare speak of Butterworth, Bessel, Chebychev, elliptic  etc?

Allan

#### Southpark

#35
##### Jun 16, 2017, 12:13 amLast Edit: Jun 16, 2017, 12:14 am by Southpark
Do we dare speak of Butterworth, Bessel, Chebychev, elliptic  etc?

Allan
I can't believe you dared to speak of those Allan! But now that you did. I believe.

#### allanhurst

#36
##### Jun 16, 2017, 12:18 amLast Edit: Jun 16, 2017, 01:24 am by allanhurst
Sorry. Not appropriate here. Multipole filters are a whole new ballgame.....

Allan

#### ilovetoflyfpv

#37
##### Jun 16, 2017, 02:58 pm
Hi Gang

Well I printed out the thread today and read it thoroughly. I was hoping that it would clarify things however it's raised more questions.

1. If I want to calculate the impedance of the circuit shouldn't I be using the PWM frequency (490Hz) in order to calculate the reactance of the capacitor?

2. The topic of Sine waves is debated numerous times most of which is pitched well above my understanding? I did like the diagram that Power_Broker included in post #13 illustrating the DC component of PWM signal along with the fundamental frequency and harmonics. It actually clarified the concept of fundamental and harmonic frequencies.

3. How do I know whether the device I'm feeding my filtered signal to is drawing current?

4. I'm still unsure about component selection. In post #29 septillion touches on the subject but I don't quite follow. Wouldn't I be interested in the acceptable ripple voltage rather than the ripple frequency? Could you expand on this?

5. The PWM signal constantly changes based on how strong the Received Signal Strength Indicator (RSSI). I imagine I need to balance responsiveness and ripple?

6. If I increase the frequency and reduce the resistor/capacitor size I gather that means the capacitor can charge/discharge quicker hence the better response?

7. If I was to use DAC what would be a good starting point?

As always I really appreciate the help.

Cheers

Jase

#### Jiggy-Ninja

#38
##### Jun 16, 2017, 04:07 pmLast Edit: Jun 16, 2017, 04:09 pm by Jiggy-Ninja
Hi Gang

Well I printed out the thread today and read it thoroughly. I was hoping that it would clarify things however it's raised more questions.
Most of it is not necessary and will be over your head, so try not to get too bogged down in the details. This firestorm of posts was only triggered by someone deciding to pointlessly argue over a distinction without a difference. If you understand the big picture concept illustrated by Power_Broker's diagram, that's more than good enough. Fourier Transforms are a part of calculus, you don't need to concern yourself with the exact details of what frequency components are in a waveform.

Quote
1. If I want to calculate the impedance of the circuit shouldn't I be using the PWM frequency (490Hz) in order to calculate the reactance of the capacitor?
Impedance is a frequency-dependent value. That's how filters (like a low-pass) work: the different frequency components of a waveform encounter different impedances in the filter, causing the output to be changed and distorted.

For the output of the DC component (the one you care about most), a simple RC low pass filter will have an output impedance equal to R. The capacitor is irrelevant.
Quote
3. How do I know whether the device I'm feeding my filtered signal to is drawing current?
If it's a chip, the datasheet will have large tables of electrical characteristics. One of those is likely to be input bias currents or input impedance for the various inputs. If it's a more complex circuit receiving the signal (like an op amp circuit with feedback networks) then it depends on the circuitry attached to the input.

Quote
4. I'm still unsure about component selection. In post #29 septillion touches on the subject but I don't quite follow. Wouldn't I be interested in the acceptable ripple voltage rather than the ripple frequency? Could you expand on this?
Correct, but the ripple frequency will be the same as the frequency of the PWM signal. You need to know that frequency in order to create an appropriate low pass filter.

Quote
5. The PWM signal constantly changes based on how strong the Received Signal Strength Indicator (RSSI). I imagine I need to balance responsiveness and ripple?
Correct.

Quote
6. If I increase the frequency and reduce the resistor/capacitor size I gather that means the capacitor can charge/discharge quicker hence the better response?
Exactly correct.

Quote
7. If I was to use DAC what would be a good starting point?

1) What is its source? Is it an analog output, or a digital value read from some chip's register?
1a) If it is analog, what are the minimum and maximum voltages?

2) How quickly does this value change? How quickly do you need to respond to changes?

3) What transformations (if any) are you performing to the signal value? I'm not referring to the analog -> PWM conversion, but changes in the actual signal value itself like multiplying or dividing it, adding or subtracting something, or filtering it in some way (not counting the PWM filter you're intending to apply).

4) What is the receiving device? Since you're trying to LPF the PWM signal, it's obviously an analog input, but to what? For what purpose?

It's entirely possible that some cheap and easy SPI DAC like an MCP4811 will be good enough for your needs. Or if you don't mind discrete components, an R-2R ladder.

Or, if the source and receiver are both analog, take the Arduino out of the signal path entirely and use an op amp circuit.

#39

#### MrMark

#40
##### Jun 16, 2017, 05:46 pm
If I put a hot soldering iron tip on a circuit board, and the temperature on that part of the circuit (where the hot iron tip is touching) abruptly rises from 25 degrees C to some relatively high temperature value. Yep...assuming this is happening in the real world, in the time domain. Better not tell anybody that the temperature rise at that part of the circuit is physically (actually) a bunch of sinusoids all individually ganging together at the same time.
Maybe you're being subversively ironic, but the Fourier Transform as we know it was introduced in Joseph Fourier's seminal manuscript on heat transfer to analyze essentially the scenario you describe.

#### Jiggy-Ninja

#41
##### Jun 16, 2017, 06:45 pm
Maybe you're being subversively ironic, but the Fourier Transform as we know it was introduced in Joseph Fourier's seminal manuscript on heat transfer to analyze essentially the scenario you describe.
I would have just quipped with a dismissive "Why can't you, if it's useful to the analysis?", but that's just so much better!

Quote
Jean-Baptiste Joseph Fourier - (/ˈfʊəriˌeɪ, -iər/; French: [fuʁje]; 21 March 1768 - 16 May 1830) was a French mathematician and physicist born in Auxerre and best known for initiating the investigation of Fourier series and their applications to problems of heat transfer and vibrations.

#### Southpark

#42
##### Jun 16, 2017, 09:12 pmLast Edit: Jun 18, 2017, 01:36 pm by Southpark
This firestorm of posts was only triggered by someone deciding to pointlessly argue over a distinction without a difference.
It was actually started by someone(s) (and I'm NOT referring to the OP because the OP is new to this area) that did not understand that a particular kind of analog waveform (referring to the PWM voltage at the PWM pin of an arduino) is not a stage-show performance featuring a bunch of sinusoidal signals - all individually doing their little parts at the same time - and combining right in front of you to yield that waveform.

I disagree with your comment: "distinction without a difference".

The frequency domain theories are fantastic for analysing waveforms, and for designing/building devices to produce waveforms or modify waveforms etc. But the measured voltage waveform at the PWM pin of an arduino is not the result of a bunch of sinusoidal signals putting on a display for you.

There is a distinction. There is a difference.

#### Power_Broker

#43
##### Jun 17, 2017, 01:47 am
1. If I want to calculate the impedance of the circuit shouldn't I be using the PWM frequency (490Hz) in order to calculate the reactance of the capacitor?
Ok, time to set one thing straight that will clarify things for you. The 490Hz that you keep bringing up is only the refresh rate. In other words, the PWM waveform repeats itself 490 times a second and this has very little to do with the frequency components of the signal - at least not as far as you're concerned. On the other hand, if you have any given waveform (periodic or not), your signal is and can be expressed as a sum of sines and cosines at different frequencies. The magnitude of these sinusuids can be plotted for a given signal in two easy to follow ways depending on whether or not the signal is periodic or not.

For instance:

For a periodic signal (such as a PWM signal of constant duty cycle):

OR for a non-periodic signal (such as a single pulse):

Notice that you are primarily interested in the first case. Keep that graphic in mind and take my word that the 490Hz you mention doesn't change anything except your fundamental frequency. There will still be an infinite number of frequency components and you are trying to get rid of all of them, leaving the DC component (where n=f=0Hz).

You may also be interested in seeing this graphic, too. It explains more clearly how the Fourier Series works:

3. How do I know whether the device I'm feeding my filtered signal to is drawing current?
You can add a buffer in between the PWM generator and the filter. You should also add a buffer to the output of the buffer. This ensures that the filter doesn't draw any current except directly from the power supply and that the impedances of the other parts of the circuit doesn't "interfere" with the filter.

5. The PWM signal constantly changes based on how strong the Received Signal Strength Indicator (RSSI). I imagine I need to balance responsiveness and ripple?

6. If I increase the frequency and reduce the resistor/capacitor size I gather that means the capacitor can charge/discharge quicker hence the better response?
Exactly. The lower the RC time constant, the more responsive, BUT that creates a larger ripple. It's a trade off.

I hope these concepts are clearer to you now. You should still google "envelope detector" for more info.
"The desire that guides me in all I do is the desire to harness the forces of nature to the service of mankind."
- Nikola Tesla

#### ilovetoflyfpv

#44
##### Jun 17, 2017, 05:40 am
Hi Power-Broker

Thanks for getting back to me. I don't understand your post from...

Quote
On the other hand, if you have any given waveform (periodic or not), your signal is and can be expressed as a sum of sines and cosines at different frequencies...
I understand Sine and Cosine relative to triangles.

What is x(t)?

What is X(w)?

What are the red arrows? Are they trying to keep up with the PWM signal?

What are the name of these graphs?

Is the Fourier Series illustration highlighting the different frequencies that comprise a fundamental frequency at a specific period in time?

What is the process for selecting the resistor and capacitor? I'm thinking I start with a resistor that doesn't overdrive the PWM pin (at 490Hz the capacitor will have a very low capacitive reactance). I then start 'playing' with different capacitor values that give good responsiveness and nominal ripple?

Thanks for sticking with me. I'm not the sharpest tool in the shed but I'm willing to work hard.

Cheers

Jase

Go Up