DFT of a series of RC exponentials












0












$begingroup$


Context: I'm trying use matlab to apply a single-pole filter to a time-domain ramp waveform that is generated by a sequence of time-shifted "RC steps" that are added together.



The time domain voltage waveform is



$V(t) = sum_{k=0}^{N-1} V_{step}(1-e^{-(t-kDelta t_{step})/tau})u(t-kDelta t_{step})$



where $V_{step}$ and $Delta t_{step}$ are constants



Using the fft of a one-sided exponential decay, the unit-step, and the time-shift property of the fft I get a frequency domain representation of:



$mathfrak{F}(V(t)) = V_{step}left(sum_{k=0}^{N-1}e^{-jomega kDelta t_{step}}right)left(frac{1}{jomega} +pidelta(omega) - frac{1}{frac{1}{tau}+jomega}right)$



So now I want to generate this complex-valued fft manually in matlab, multiply by a filter response, and inverse fft. To start, I'm checking the frequency response of the input and its ifft to make sure it looks right:



N=32;
Vstep=25e-3;
tstep=10e-12;
tau=5e-12;
ts=0.1e-12;

Nfft = 2^nextpow2(max([N*tstep/ts N*tau*5/ts])); %Get enough points for the whole ramp with at least 5 tau's per exponenetial
w=(0:Nfft-1)*2*pi/Nff;t
f=w/2/pi/ts;

timeshifts=sum(exp(-1i*(0:N-1)'*w*tstep));
step=[pi 1./(1i*w(2:end))];
expdecay=1./(1/tau+1i*w);

Vf=Vstep*timeshifts.*(step-expdecay);
vt=ifft(V);


So the frequency domain Vf looks reasonable in amplitude. However, when I take the inverse and plot vt, it is definitely not correct.



Where am I going wrong? I suspect there's something I'm missing with the fact that this is a DFT not fourier transform. Also I know there's some subtlety to the FT/DFT of the heaviside, particularly at w=0, and I know that the fft at 0 will just be the average (times N) and I'm not sure my script accomplishes this.



I do know that I can just start with the time domain and then fft it, but I'm rather curious now.










share|cite|improve this question









$endgroup$

















    0












    $begingroup$


    Context: I'm trying use matlab to apply a single-pole filter to a time-domain ramp waveform that is generated by a sequence of time-shifted "RC steps" that are added together.



    The time domain voltage waveform is



    $V(t) = sum_{k=0}^{N-1} V_{step}(1-e^{-(t-kDelta t_{step})/tau})u(t-kDelta t_{step})$



    where $V_{step}$ and $Delta t_{step}$ are constants



    Using the fft of a one-sided exponential decay, the unit-step, and the time-shift property of the fft I get a frequency domain representation of:



    $mathfrak{F}(V(t)) = V_{step}left(sum_{k=0}^{N-1}e^{-jomega kDelta t_{step}}right)left(frac{1}{jomega} +pidelta(omega) - frac{1}{frac{1}{tau}+jomega}right)$



    So now I want to generate this complex-valued fft manually in matlab, multiply by a filter response, and inverse fft. To start, I'm checking the frequency response of the input and its ifft to make sure it looks right:



    N=32;
    Vstep=25e-3;
    tstep=10e-12;
    tau=5e-12;
    ts=0.1e-12;

    Nfft = 2^nextpow2(max([N*tstep/ts N*tau*5/ts])); %Get enough points for the whole ramp with at least 5 tau's per exponenetial
    w=(0:Nfft-1)*2*pi/Nff;t
    f=w/2/pi/ts;

    timeshifts=sum(exp(-1i*(0:N-1)'*w*tstep));
    step=[pi 1./(1i*w(2:end))];
    expdecay=1./(1/tau+1i*w);

    Vf=Vstep*timeshifts.*(step-expdecay);
    vt=ifft(V);


    So the frequency domain Vf looks reasonable in amplitude. However, when I take the inverse and plot vt, it is definitely not correct.



    Where am I going wrong? I suspect there's something I'm missing with the fact that this is a DFT not fourier transform. Also I know there's some subtlety to the FT/DFT of the heaviside, particularly at w=0, and I know that the fft at 0 will just be the average (times N) and I'm not sure my script accomplishes this.



    I do know that I can just start with the time domain and then fft it, but I'm rather curious now.










    share|cite|improve this question









    $endgroup$















      0












      0








      0





      $begingroup$


      Context: I'm trying use matlab to apply a single-pole filter to a time-domain ramp waveform that is generated by a sequence of time-shifted "RC steps" that are added together.



      The time domain voltage waveform is



      $V(t) = sum_{k=0}^{N-1} V_{step}(1-e^{-(t-kDelta t_{step})/tau})u(t-kDelta t_{step})$



      where $V_{step}$ and $Delta t_{step}$ are constants



      Using the fft of a one-sided exponential decay, the unit-step, and the time-shift property of the fft I get a frequency domain representation of:



      $mathfrak{F}(V(t)) = V_{step}left(sum_{k=0}^{N-1}e^{-jomega kDelta t_{step}}right)left(frac{1}{jomega} +pidelta(omega) - frac{1}{frac{1}{tau}+jomega}right)$



      So now I want to generate this complex-valued fft manually in matlab, multiply by a filter response, and inverse fft. To start, I'm checking the frequency response of the input and its ifft to make sure it looks right:



      N=32;
      Vstep=25e-3;
      tstep=10e-12;
      tau=5e-12;
      ts=0.1e-12;

      Nfft = 2^nextpow2(max([N*tstep/ts N*tau*5/ts])); %Get enough points for the whole ramp with at least 5 tau's per exponenetial
      w=(0:Nfft-1)*2*pi/Nff;t
      f=w/2/pi/ts;

      timeshifts=sum(exp(-1i*(0:N-1)'*w*tstep));
      step=[pi 1./(1i*w(2:end))];
      expdecay=1./(1/tau+1i*w);

      Vf=Vstep*timeshifts.*(step-expdecay);
      vt=ifft(V);


      So the frequency domain Vf looks reasonable in amplitude. However, when I take the inverse and plot vt, it is definitely not correct.



      Where am I going wrong? I suspect there's something I'm missing with the fact that this is a DFT not fourier transform. Also I know there's some subtlety to the FT/DFT of the heaviside, particularly at w=0, and I know that the fft at 0 will just be the average (times N) and I'm not sure my script accomplishes this.



      I do know that I can just start with the time domain and then fft it, but I'm rather curious now.










      share|cite|improve this question









      $endgroup$




      Context: I'm trying use matlab to apply a single-pole filter to a time-domain ramp waveform that is generated by a sequence of time-shifted "RC steps" that are added together.



      The time domain voltage waveform is



      $V(t) = sum_{k=0}^{N-1} V_{step}(1-e^{-(t-kDelta t_{step})/tau})u(t-kDelta t_{step})$



      where $V_{step}$ and $Delta t_{step}$ are constants



      Using the fft of a one-sided exponential decay, the unit-step, and the time-shift property of the fft I get a frequency domain representation of:



      $mathfrak{F}(V(t)) = V_{step}left(sum_{k=0}^{N-1}e^{-jomega kDelta t_{step}}right)left(frac{1}{jomega} +pidelta(omega) - frac{1}{frac{1}{tau}+jomega}right)$



      So now I want to generate this complex-valued fft manually in matlab, multiply by a filter response, and inverse fft. To start, I'm checking the frequency response of the input and its ifft to make sure it looks right:



      N=32;
      Vstep=25e-3;
      tstep=10e-12;
      tau=5e-12;
      ts=0.1e-12;

      Nfft = 2^nextpow2(max([N*tstep/ts N*tau*5/ts])); %Get enough points for the whole ramp with at least 5 tau's per exponenetial
      w=(0:Nfft-1)*2*pi/Nff;t
      f=w/2/pi/ts;

      timeshifts=sum(exp(-1i*(0:N-1)'*w*tstep));
      step=[pi 1./(1i*w(2:end))];
      expdecay=1./(1/tau+1i*w);

      Vf=Vstep*timeshifts.*(step-expdecay);
      vt=ifft(V);


      So the frequency domain Vf looks reasonable in amplitude. However, when I take the inverse and plot vt, it is definitely not correct.



      Where am I going wrong? I suspect there's something I'm missing with the fact that this is a DFT not fourier transform. Also I know there's some subtlety to the FT/DFT of the heaviside, particularly at w=0, and I know that the fft at 0 will just be the average (times N) and I'm not sure my script accomplishes this.



      I do know that I can just start with the time domain and then fft it, but I'm rather curious now.







      fourier-analysis matlab fast-fourier-transform






      share|cite|improve this question













      share|cite|improve this question











      share|cite|improve this question




      share|cite|improve this question










      asked Feb 1 at 23:20









      KaysonKayson

      613




      613






















          0






          active

          oldest

          votes












          Your Answer





          StackExchange.ifUsing("editor", function () {
          return StackExchange.using("mathjaxEditing", function () {
          StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
          StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
          });
          });
          }, "mathjax-editing");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "69"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          noCode: true, onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3096850%2fdft-of-a-series-of-rc-exponentials%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Mathematics Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          Use MathJax to format equations. MathJax reference.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3096850%2fdft-of-a-series-of-rc-exponentials%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          MongoDB - Not Authorized To Execute Command

          How to fix TextFormField cause rebuild widget in Flutter

          in spring boot 2.1 many test slices are not allowed anymore due to multiple @BootstrapWith