FORUM TOPIC · READ ONLY

Input Capture Block and Output Compare block

Input Capture Block and Output Compare block

Forum : General Remark and Questions

4 message(s) · archive en lecture seule

val
Hi Lubin,



By accident I found your embedded target for Microchip dsPIC.

I am a student at the Technical University of Delft in The Netherlands.

For one of my projects I need to capture a frequency of 500Hz and filter random noise away.

I consider to use your Input Capture Block and Output Compare block.

Can you provide me with some models? I have searched for it on your Forum, but I could not find models with the Input Capture Block.



Val
LubinKerhuel

Re: Input Capture Block and Output Compare block

Hi Val,



I hope this is a nice accident !



you will find example about Input Capture block on the example page : http://www.kerhuel.eu/wiki/Category:Example

look at the autopilote model, I think it's using IC blocks.



Also, have a look on the IC block help : http://www.kerhuel.eu/wiki/Block/Output_Compare



your information is coded in Pulse Width Modulation ?



If you want to filter an analog signal at 500Hz, use the ADC block and configure the simulink time step at 500Hz. Example of such filtering is explain (and one example is in the example directory of the blockset)



Lubin
val

Re: Input Capture Block and Output Compare block

Hi Lubin,



Thank you very much for the appreciated intention to help me.

However, I am a little bit confused, because I cannot find the simulink model on the page of the the autopilote model.



You wrote:

If you want to filter an analog signal at 500Hz, use the ADC block and configure the simulink time step at 500Hz. Example of such filtering is explain (and one example is in the example directory of the blockset)



Please give me the name of the examples. Are you talking about two examples?

I suppose the time step in the solver must be the same as in the ADC block? And how to set the period in the Output Compare block to get a fine resolution.

How to configure the time step if I expect an analog signal from 400Hz to 500Hz and I want to filter out a signal of 440Hz with a Notch filter?

I suppose I have to take into account the Nyquist theorem.



Val
LubinKerhuel

Re: Input Capture Block and Output Compare block

Hi Val,



I respond very quickly:


Citation : val
I cannot find the simulink model on the page of the the autopilote model

Ok, I did not upload it yet. my mistake. Will do it soon.


Citation : val
Please give me the name of the examples.

http://www.kerhuel.eu/wiki/Explorer_16_Board


Citation : val
I suppose the time step in the solver must be the same as in the ADC block?

it must be equal or higher. (equal is the easiest solution)


Citation : val
how to set the period in the Output Compare block to get a fine resolution

Have a look on the block's help. or a quick glance at the examples.


Citation : val
I want to filter out a signal of 440Hz with a Notch filter

About nyquist frequency, the question is which frequency are you willing to keep ? and How to keep them untouthced ?

If you undersample your signal (at a frequency lower than the nyquist frequcney : 880Hz, the 440Hz will be folded into a lower frequency that you can still filter out. (for example if your real 440Hz is folded in 200Hz because of low frequency sampling, you may filter out that 200Hz, but that will also remove the 200Hz of the real signal !).

You may find smart solution using this principle ! you should Have a look first on the frequency present in the original signal.

Anyway, if you want to keep it simple, sample at something like 2Khz and filter out the 440Hz with a notch filter.



I'll be absent for two weeks from now (from 5 of june until 20 of june 2009). Thus, I will not be able to provide response for that time. If anybody can give you answers during theses two weeks...



Lubin