cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
thijscraenmehr
Visitor
Visitor
3,698 Views
Registered: ‎05-19-2011

How to implement 'if'-loop with clock

I want to implement the if-loop to do something like this.

 

Input signal (u1) is a microphone.

Then I want the 'if'-block to do:     

if (u1 > 0.5)

   reset the clock to 0.

else

   keep reading input signal

end

 

I also don't know how to set up a clock that follows the input signal of the microphone real-time.

 

Anyone can help?

Thijs

0 Kudos
2 Replies
joelby
Advisor
Advisor
3,690 Views
Registered: ‎10-05-2010

Is u1 being sampled by an ADC? If so, you'll probably want to use the ADC's sampling clock in your synchronous process.

 

If u1 is an asynchronous digital signal, you would normally sample it using a system clock, or a derived frequency thereof.

 

0 Kudos
drjohnsmith
Teacher
Teacher
3,683 Views
Registered: ‎07-09-2009

Hi

 

so what language / tool do you want to use ?

 

<== If this was helpful, please feel free to give Kudos, and close if it answers your question ==>
Tags (1)
0 Kudos