Click here to Skip to main content
16,006,707 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionCopy directory Pin
kindaichinisan19-Jun-08 22:01
kindaichinisan19-Jun-08 22:01 
AnswerRe: Copy directory Pin
Hamid_RT19-Jun-08 22:06
Hamid_RT19-Jun-08 22:06 
Questiondll export Pin
shakumar_2219-Jun-08 21:11
shakumar_2219-Jun-08 21:11 
AnswerRe: dll export Pin
CPallini19-Jun-08 21:19
mveCPallini19-Jun-08 21:19 
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 
[ Quote ]
it seems that applying a low-pass filter will attenuate the high frequencies (i.e. higher that the cutoff frequency). The attenuation will depend of the type of the filter (Bessel, Butterworth, ...) and its order. Please tell me if I am wrong!
[ /Quote ]

No, you are right. As I told you in the other post (sorry for the delayment, I was away for some days)

[ Quote ]
if I have two timestamps which are "to close" (for example : 1/(time[1]-time[0]) > cutoff), I need to modify the corresponding value (value [1]).
[ /Quote ]

I think you are not having the idea. The filters are to be used with the frecuency of the signals you need to process, but have nothing to do with the timestamps where you are getting the values. Let's try with a example:


......./\............./\............../
......|..|............|..|............|
......|..|............|..|............|
...../....\........./....\........../
..../......\......./......\......../
.../........\...../........\....../
../..........\.../..........\..../
.|............|..|............|..|
.|............|..|............|..|
/..............\/.............\/

You have a signal like that for example. With the Fourier theoreme you can separate the signal into different ones (sinus-signal) which addition will be the original.
The result can be one sinus very thin but taller and other one with more width but shorter.

That means, one signal has more frecuency (the thin one) and more amplitude (vertical size) than the other. If you apply a low-pass filter, depending on which one, its cut-off frecuency and its order you will have a different result. Let's say that the "taller" signal is 150Hz and the shorter one is 50Hz. If your cuttoff frecuency is 60Hz then your result will be a signal quite similar to the second signal that compose the example drawn. It won't be exactly the same because the "taller" signal won't be totally filtered, but quite attenuated (so its vertical size will be much lower).

How much does a filter attenuate? If I remember ok it was a "fixed" order-related rate. For filters of first order the attenuation was 20 db, for second order was 40db and so on. This is easier to see in BODE-Diagramms (remember my last answer?)

first order
-----------
............\
..............\
................\
..................\
....................\


second order
-----------
............\
.............\
..............\
...............\
................\


Both have the same cuttof frecuency (the point where the ramp begins), but the order is the ramp inclination, for 1st order is 20db/dec and for 2nd order is 40db/dec (dec = decade???? "decada" on spanish)


So... turning back to your question...
"if I have two timestamps which are "to close" (for example : 1/(time[1]-time[0]) > cutoff)" this has nothing to do with the frecuency of the signal, this are the time between two measures. Frecuency is the time that the signal needs to be in the same value in the same conditions two times (red marked in my example function). That means, same value (for example 1.2) both going upwards. Then is valid what you say "frec = (1 / (time [1] - time [0]))" and that should be compared with the cutoff frecuency.

But another time a problem. This is only valid for pure signals "sinus-cosinus", "triangle", "square"... if you have signals with "strange" forms... you will need to apply fourier to separate it into different pure signals of different frecuencies. Then apply the filters and see how each component is going to be affected, and remount the end result with the addition of their curves.



About the algorithm... sorry but it is not so easy, it depends on many factors so there is no possible easy "general" application to be given. You will need to investigate and to make it fit your needs.

A tip... Matlab has already implemented some things that can be usefull for you. For example, giving timestamps arrays and values it draws the graphic. With the graphic (if the signal is not very complicated) you will easily get the transfer function. You can "easily" (when you know how) transform to bode-diagramms or apply fourier.


P.S. I am seeing it from the electrical perspective. I mean, I can be wrong in focusing the solution from the "informatic side" but concepts are concepts, and you seem to be a bit lost with them.


Hope it helps

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.

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

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.