I am given a square wave with Vmin = 0V and Vmax=5V , T(period)=8ms and duty cycle 25%. I am asked to find the properties(low cutoff , high cutoff , bandwidth) of a band pass filter that will make the signal a sine with T=4ms. My answer would be that the Δf = 1/Δt where Δt=4ms . So the Δf=250Hz and therefore the actual value of lowcutoff and highcutoff doesn't matter as long as their difference is 250Hz. It was pointed to me that this is wrong , I don't understand why. What would be the right answer to this problem?
You have highly non-symmetric 125Hz rectangular pulse train. It really happens to have also 250Hz component when expressed as a sum of pure sinusoidal voltages. Symmetric square wave (the durations of both halves =equally long) wouldn't have anything at 250Hz.
Generally filters do not change the frequencies of the spectral components of the input signal, only attenuate or amplify some of them. Your case: You want to pass 250Hz component through and remove others (=0Hz, N*125Hz where N= 3,4,5,...)
Your easiest filter to extract the 250Hz component is a high Q (=narrow bandwidth) 2nd order bandpass filter with 250Hz center frequency. You should have a spec, how much content at other frequencies is allowed. Without that spec you cannot decide the exact needed Q.
Of course you could say "attenuate fully off everything else, but leave the 250Hz component as is. Unfortunately such practical filters do not exist, all designs are based on how much the wanted frequency components are allowed to get attenuated and how much attenuation is the minimum for unwanted components.
Can a filter change the frequency of the input signal?
Well, sort of, in a manner of speaking. You have described the input signal as a pulse train with frequency of 125 Hz and a duty cycle of 25%. Since you claim to be quite familiar with Fourier transforms, you must have recognized that the spectrum of the signal will contain components of 125 Hz and its harmonics (250, 375, 500, 625, etc). Then you can filter out any of these, producing an output at a frequency different from the fundamental (125 Hz) of the input. Furthermore, the output amplitude of the filter will be proportional to the amplitude of the input, so you can speak of "changing" the input frequency. Whether you want to call this changing, or selecting a part of the input is up to you.
the actual value of lowcutoff and highcutoff doesn't matter as long as their difference is 250Hz. It was pointed to me that this is wrong , I don't understand why.
Come, let us reason together. Let's assume a perfect, brickwall filter, with a lowpass cutoff of 100 Hz and a high-pass of 350. This will let both the 125 Hz and 250 Hz components of the original pass. I've not done a detailed analysis, but the 125 Hz component will be larger than the 250 Hz, and depending on the exact relative amplitudes the output will be either 125 or 250 Hz. And the situation will become even more complex if you use low-order filters with gradual rolloff. Then NO component will be completely suppressed.
Even worse, let's say the lowpass frequency is 950 Hz and the high-pass is 1200. The difference is 250 Hz, right? Then the frequencies passed to the output will be 1000 Hz and 1125 Hz (again, for brickwall filters). Do you really think that this will produce a 250 Hz signal?
Can a filter change the frequency of the input signal?
I wouldn't call it "changing frequency", but that is... indirectly what you are doing if you remove all other harmonics except for one specific frequency.
In your case you have many harmonics, the 250 Hz being one of them. So all you need to do is to make a sharp band pass filter centered around 250 Hz.
However, you can't change a 100 Hz sine wave into a 133 Hz (or any other than 100 Hz) sine wave with only passive components.
I'd go with the following settings, assuming a very high filter order:
- low cutoff: 249 Hz
- high cutoff: 251 Hz
- bandwidth: 2 Hz
It's like asking this question:
Can a person turn a car into a steering wheel?
Sure, remove the entire car except for the steering wheel and there you go. You've changed the car into a steering wheel.
But you can't change the car into a rock, because there's no rock inside of a car.
You are trying to select the second harmonic from a signal which contains many harmonics of 125 Hz. Therefore the BW must be substantially less than 125 Hz to avoid selecting more than one harmonic.
The lower frequency cutoff needs to be somewhere between 125 Hz and 250 Hz. The upper frequency cutoff needs to be somewhere between 250 and 375 Hz. I would suggest putting the lower cutoff at sqrt(125*250) and the upper cutoff at sqrt(250*375). I believe this will give you the best balance between maintaining high gain in the pass-band, and maximizing attenuation in the reject band.
Linear passive analog circuits implement the Convolution (akin to correlation) of the input time waveform with the circuit's impulse response.
What we have been taught to be "harmonics" are simply the combined forced and natural responses of the circuit. Bluntly, harmonics do not exist, instead are an artifact (a useful artifact, for thinking about power) of the math.
That said, here is Signal Wave Explorer with 125 Hz input, 25% duty cycle, 2.5% sample spacing (so the high time and the low time have exact integer # samples), with zero-time rise and fall.
The "system" is L+C filter with Q of 10: 1uF, 405milliHenry, Rloss of 66 ohms.
Note from plot #4 (counting from the top) there is still some 2nd harmonic. And the output time waveform shows amplitude variation.