Click here to Skip to main content
15,917,543 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionLow-pass filter questions Pin
jeremie.delaitre19-Jun-08 20:36
jeremie.delaitre19-Jun-08 20:36 
GeneralRe: Low-pass filter questions Pin
CPallini19-Jun-08 21:09
mveCPallini19-Jun-08 21:09 
GeneralRe: Low-pass filter questions Pin
jeremie.delaitre19-Jun-08 21:55
jeremie.delaitre19-Jun-08 21:55 
AnswerRe: Low-pass filter questions Pin
Nelek19-Jun-08 22:55
protectorNelek19-Jun-08 22:55 
GeneralRe: Low-pass filter questions Pin
jeremie.delaitre19-Jun-08 23:34
jeremie.delaitre19-Jun-08 23:34 
GeneralRe: Low-pass filter questions Pin
Nelek19-Jun-08 23:43
protectorNelek19-Jun-08 23:43 
QuestionRe: Low-pass filter questions Pin
jeremie.delaitre19-Jun-08 23:22
jeremie.delaitre19-Jun-08 23:22 
AnswerRe: Low-pass filter questions Pin
Nelek20-Jun-08 0:29
protectorNelek20-Jun-08 0:29 
"The transfer function gives me the "filtered values". I must apply it on all my values to get the filtered ones."

Yes.

"To apply the transfer function, I need to compute the value of each coefficient which depend of the type of the filter (Bessel, Butterworth...) and the order."

correct

"Next I apply the function on my values using the coefficients in a simple algorithm."

You can do it at the same time you are getting the value as well. Under certain conditions (see below)


"The problem is that what I said here seems to work only for constant sampling."

This will most probably be because the constant sampling is given by the frecuency of the signal. but...


"In my case, the elapsed time between two values is not always the same. How can I handle that ?"

The moment you are taking the values (sampling) is not so important. The important thing is that you have to get the transfer function of the signal you are meassuring. Filters can only be used in periodical signals, that means time-repetitive working patrons. Once you have the function that define your signal... A simple transfer function if the signal is pure or a fourier-series function if your signal is a mix of different signals (this is not a must, but having it separated makes it easier). Then you just apply the filter for the value at that moment. Frecuency of a signal should be constant, so you can use "t" (time) or "s" (time in laplaced functions) parameters insteads of using "f".




"Does it mean that for low-pass Bessel filter I need to apply the Bessel transfer function on value which are to close?"

If your signal is not periodical... you must not apply filters. If your signal is periodical... you should not use it that way. Example: You have a pure sinus signal centered in the zero axis with amplitude top at 1 and bottom is -1 (don't remember if it is amplitude 1 or 2). With frecuency 1 Hz, ok? Then ONCE a second you will be in the same point of your graphic, (i.e. every full second at the top of the function value 1).

then your sampling will have always the same pattern, time 1s -> value 1; time 1,25s -> value 0; time 1,5s -> value -1; time 1,75s -> value 0; time 2s -> value 1

and so on with the intermediate values...

Then if you apply a filter which cutoff frecuency is near 1Hz you will have an attenuation of the amplitude but the frecuency will be the same, let's say that instead of 1 and -1 now you have 0,7 and -0,7.

Now if we make the signal a bit more difficult, let's say... a combination of that simple one, and another sinus with frecuency 10Hz and amplitude 0.25, -0.25 then you will have a little and fast sinus wave centered in the first one going up and down.

If we complicate it a bit more adding a slower signal with a big amplitude you will have something more strange as result. And this is the principle of Fouriers theoreme. As long as a signal periodical is, there is always the possibility to get that signal as a combination of different independant signals with different amplitudes and frecuencies, that are called (armónicos on spanish) ???armonics???. So when you apply a filter the result of the original signal will be a bit weird to be seen or imagined, but if you apply the filter to the fourier serie it will be easily recognised how every one of them change and the result will be the same.


The biggest problem you are going to have is to delimitate your scenario, find out the function (or addition of functions) of your signal and choose the right filter and its best order to fit your problem. Once made that, to apply the algorithm of the filter into your programm should be so easy as apply a mathematical formula to a parameter.

Regards.
--------
M.D.V. Wink | ;)

If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
Rating helpfull answers is nice, but saying thanks can be even nicer.

QuestionRe: Low-pass filter questions Pin
jeremie.delaitre20-Jun-08 2:49
jeremie.delaitre20-Jun-08 2:49 
AnswerRe: Low-pass filter questions Pin
Nelek20-Jun-08 3:09
protectorNelek20-Jun-08 3:09 
GeneralRe: Low-pass filter questions Pin
jeremie.delaitre20-Jun-08 3:23
jeremie.delaitre20-Jun-08 3:23 
Answerhttp://www.musicdsp.org Pin
div!sion20-Jun-08 0:24
div!sion20-Jun-08 0:24 
GeneralRe: http://www.musicdsp.org Pin
jeremie.delaitre20-Jun-08 3:10
jeremie.delaitre20-Jun-08 3:10 
AnswerRe: Low-pass filter questions Pin
cp987620-Jun-08 0:55
cp987620-Jun-08 0:55 
GeneralRe: Low-pass filter questions Pin
jeremie.delaitre20-Jun-08 3:01
jeremie.delaitre20-Jun-08 3:01 
GeneralRe: Low-pass filter questions Pin
Nelek20-Jun-08 3:12
protectorNelek20-Jun-08 3:12 
QuestionTerminal Server [modified] Pin
subramanyeswari19-Jun-08 19:53
subramanyeswari19-Jun-08 19:53 
AnswerRe: Terminal Server Pin
Naveen19-Jun-08 21:38
Naveen19-Jun-08 21:38 
GeneralRe: Terminal Server Pin
subramanyeswari19-Jun-08 22:58
subramanyeswari19-Jun-08 22:58 
GeneralRe: Terminal Server [modified] Pin
subramanyeswari20-Jun-08 0:18
subramanyeswari20-Jun-08 0:18 
AnswerRe: Terminal Server Pin
KarstenK20-Jun-08 3:20
mveKarstenK20-Jun-08 3:20 
GeneralRe: Terminal Server Pin
subramanyeswari20-Jun-08 3:52
subramanyeswari20-Jun-08 3:52 
QuestionSIP API for Video C.onferencing Pin
am 200919-Jun-08 18:59
am 200919-Jun-08 18:59 
AnswerRe: SIP API for Video C.onferencing Pin
Rajesh R Subramanian19-Jun-08 19:57
professionalRajesh R Subramanian19-Jun-08 19:57 
Questionhow can i generate a Enhanced- metafile for a word document Pin
vicky0000019-Jun-08 17:47
vicky0000019-Jun-08 17:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.