circuitcellar.com
Magazine Support   Digital Library   Products & Services   Suppliers Directory 
 
 





EQ Archive

 

August 2005, Issue 181

Test Your EQ

Each month, Test Your EQ presents some basic engineering problems for you to test your Engineering Quotient. What's your EQ?



                      

Problem 1—What sort of filter is this? What applications is it good for?

int filter (int sample)
{
  static int previous;
  if (abs(sample - previous) > 1) previous = sample;
  return previous;
}

Answer

Problem 2—What sort of filter is this?

 int filter (int sample)
{
  static int previous;
  previous = (previous >> 2) + (sample >> 2);
  return previous;
}

Answer


Problem 3—
What is a median-value filter? For what sort of applications is it well suited?

Answer

Problem 4—Write a C preprocessor macro that produces a mask for a bit field, given the numbers of the leftmost and rightmost bits in the field. In other words, FIELD_MASK(7,4) should produce the value 0x00F0.

Answer


Previous Month

   

E-mail eq@circuitcellar.com with questions or comments.