2
\$\begingroup\$

I got asked the question at an Analog devices intern interview " Draw the output across the capacitor if a square wave is the input to a high pass filter " . It was the only one I couldn't answer properly.

To my mind an ideal high pass filter should block any low frequencies, and as a square is composed of the odd harmonics of the fundamental , I presumed the output would just look more sinusoidal.

When I researched afterwards , none of the explainations online seemed to fully explain how positive and negative spikes on output occur ( even if input doesn't go negative ) .

Am I missing something here ? I didn't take into consideration the phase shift that occurs in non linear filters . Is this part of the reason the output presents itself as spikes at low frequencies ?

\$\endgroup\$
6
  • 1
    \$\begingroup\$ Have you tried simulating this situation to see what happens? \$\endgroup\$
    – The Photon
    Jan 14, 2017 at 3:51
  • 2
    \$\begingroup\$ That's an odd way to ask the question. The output of a simple R-C high-pass filter is across the R, not across the C. \$\endgroup\$
    – Dave Tweed
    Jan 14, 2017 at 6:19
  • 2
    \$\begingroup\$ a high pass filter doesn't have an output with a capacitor across it, that's the first problem to sort out. Draw a schematic of the filter you're considering. \$\endgroup\$
    – Neil_UK
    Jan 14, 2017 at 6:19
  • 1
    \$\begingroup\$ Good to know that Analog Devices is hiring. I was afraid they were going to shrink after the merger. \$\endgroup\$
    – user76844
    Jan 14, 2017 at 8:13
  • 2
    \$\begingroup\$ Read the question - it asks for the waveform across the capacitor! \$\endgroup\$
    – Chu
    Jan 14, 2017 at 8:17

2 Answers 2

8
\$\begingroup\$

The question as it stands has an answer that depends on the square wave parameters and the filter characteristics.

Therefore you have to know at least the frequency of the square wave and the cutoff frequency of the filter. Moreover some details may differ if the filter is a simple one-pole passive RC filter or is more complex.

The comment you make in your question about non-linear filters is unclear. The term "filter", by the usual definition, refers to a linear device (unless you are analyzing non-linear effects in active filters). If you are dealing with a more complex signal processing device you should be more precise and add information.

Anyway, I'll assume that you are talking about a simple 1-pole passive RC filter like the following:

schematic

simulate this circuit – Schematic created using CircuitLab

The first thing to notice, as @Neil_UK said in a comment to your question, is that the output is across the resistor, not across the capacitor.

If you took the output across the capacitor you would have a low-pass filter, instead! Maybe that was a trick question, otherwise you may have spelled it out in a wrong way in your post.

Assuming the output is across the resistor, you should think about the relative positions of the square wave frequency, let's call it \$f_s\$, and the filter cut-off frequency, let's call it \$f_c\$.

There are three relevant cases:

  1. \$ f_s >> f_c\$
  2. \$ f_s << f_c\$
  3. \$ f_s \approx f_c\$

The first is easy: if the square wave frequency lies well above the cut-off of the filter the harmonics of the wave will pass almost unaltered, therefore you'll have essentially the same signal at the output

The second is a little more complicated: since higher harmonics' amplitude decays with frequency (i.e. with the harmonics' order), most of the relevant harmonics of the signal fall in a frequency interval where the frequency response of the filter is growing linearly (on a Bode plot), so the filter acts as a (non-ideal) differentiator for the signal. In this case you'll get an output signal which is almost zero between signal edges, whereas you'll get spikes in correspondence to the square wave's edges.

The third case (\$f_s\$ near cut-off) is something in-between, especially if the fundamental component is just below cut-off. The signal will be distorted: the fast-rising edges will pass, but the flat part will be attenuated, so you'll have an exponential decay shape between edges.

You didn't state whether the square wave has a DC component (DC offset), anyway even if present that DC level will be stripped-off the output signal, which will have no DC component in any case (thanks to @Gregory Kornblum for pointing this out in a comment).

The following are the results of an LTspice simulation in the three cases:

enter image description here

enter image description here

enter image description here

\$\endgroup\$
2
  • \$\begingroup\$ It would be nice to mention that in any case DC level of output is zero, even if it was something else on input. \$\endgroup\$
    – user76844
    Jan 14, 2017 at 8:11
  • \$\begingroup\$ @GregoryKornblum Thanks for the hint. I edited my answer accordingly. \$\endgroup\$ Jan 14, 2017 at 8:40
0
\$\begingroup\$

Assuming the question in inverted commas is verbatim, it asks for the output waveform 'across the capacitor'. So the correct answer is the low-pass filtered waveform.

Perhaps the interview panel was looking for an answer to the question posed, and not an incorrect interpretation of it.

\$\endgroup\$
1
  • 1
    \$\begingroup\$ Teachers & Interviewers may seek to cull those who've memorized by posing a strange scenario. In this case, the subject must clarify, or at least recognize that the question centers on a circuit voltage that is not the output. Sweet,(devious). A deeper knowledge is required. \$\endgroup\$
    – glen_geek
    Jan 14, 2017 at 20:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.