2
$\begingroup$

I am developing a project where I must analyze an incoming signal that was acquired from a microcontroller. The objective is to obtain the main frequency of the incoming signal.

At first, I’m analyzing an RC step response signal. So, basically, I want to obtain the frequency response, from the characteristic charging curve of an RC circuit.

My mentor told me that I could achieve this with the FFT. He told me that if I applied it twice at the incoming signal, I would obtain the frequency response curve. I think I did, but my only issue is the frequency axis. They’re completely messed up. Even when I apply the method to obtain the frequencies, it goes bad. (I know it's wrong because my cut-off frequency is around 11 Hz)

https://drive.google.com/file/d/1-ppjp6qE8J8O96Lj4uaJx36o2pt3KMSG/view?usp=sharing

So, what I’m asking is:

  1. Why is it that applying the FFT twice to the signal give the frequency response?

  2. Does anyone know how I can obtain the correct frequency axis?

$\endgroup$
1
$\begingroup$

Taking the FFT twice is similar to a method called "cepstrum". It finds the spacing between harmonics. You need to measure an oscillating signal to apply this. I would go back to your mentor for more clarification.

Here is a solution for accurately measuring your charging rate in your diagram: least square fitting to inverse exponential function

Ced


Followup:

I was very impressed by these articles.

From RC Charging Circuit in the section labeled: "RC Time Constant, Tau"

$$ V_c = V_s ( 1 - e^{-t/(RC)} ) $$

So when $ t = R C $ then $\frac{V_c}{ V_s} \approx .63 $

Since you already know $V_s$, the technique I referenced earlier is not necessary. Looking at your graph $ R C \approx .07 $.

From Passive Low Pass Filter in the section labeled: "Cut-off Frequency and Phase Shift"

$$ f_c = \frac{ 1 }{ 2 * \pi * R C } $$

Your cutoff frequency can then be found: $ f_c \approx 2.27 $

From the section labeled: "RC Low Pass Filter Circuit"

$$ X_c = \frac{1}{ 2 \pi f C } $$

$$ V_{out} = V_{in} \cdot \frac{X_c}{ \sqrt{ R^2 + X_c^2 } } $$

Divide the numerator and denominator by $X_c$:

$$ \frac{ V_{out} }{ V_{in} } = \frac{1}{ \sqrt{ \left( \frac{R}{X_c} \right)^2 + 1 } } $$

Substitute in $X_c$ and simplify:

$$ \frac{ V_{out} }{ V_{in} } = \frac{1}{ \sqrt{ \left( 2 \pi f R C \right)^2 + 1 } } $$

Now take the log (base 10):

$$ \log \left( \frac{ V_{out} }{ V_{in} } \right) = -\frac{1}{2} \log \left( \left( 2 \pi f R C \right)^2 + 1 \right) $$

From the section labeled: "Low Pass Filter Summary"

$$ Gain_{db} = 20 * \log \left( \frac{ V_{out} }{ V_{in} } \right) $$

Plug in the log of your voltage ratio to get:

$$ Gain_{db} = -10 \log \left( \left( 2 \pi f R C \right)^2 + 1 \right) $$

Your cutoff frequency is below the audible range of Hz, so you are going to attenuate all your frequency. The higher the frequency, the greater the attenuation. To find you fundamental frequency I recommend using a FFT and the frequency calculations I present in my blog articles. You can find the link on my profile page.

$\endgroup$
  • $\begingroup$ I will. Just to clarify it for me, do you think there is a way to obtain a Bode plot of an RC step response, without having its transfer function? I think, ultimately, this is my question $\endgroup$ – tbarros Mar 25 '18 at 12:44
  • $\begingroup$ I'm a little outside my comfort zone answering that. Check this reference out: electronics-tutorials.ws/filter/filter_2.html $\endgroup$ – Cedron Dawg Mar 25 '18 at 13:06
  • $\begingroup$ Thank you anyways! I've been fighting with this for a long time, but now I have a starting point! $\endgroup$ – tbarros Mar 25 '18 at 13:39
  • $\begingroup$ I have worked the math. Your RC is about .07 and your cutoff frequency is about 2.27 Hz (assuming your time scale is in second on your first chat). Do you want me to post the equations or would that be a spoiler? $\endgroup$ – Cedron Dawg Mar 25 '18 at 15:58
  • $\begingroup$ I'd be very much grateful,if you could $\endgroup$ – tbarros Mar 26 '18 at 11:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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