Skip to main content
1-Visitor
October 16, 2014
Solved

Simple (I think) query. Convert a function to a Vector...

  • October 16, 2014
  • 1 reply
  • 2146 views

Hi,

I'm sure this is real easy but I can't see the wood for the trees. Given a function which uses a range variable as it's parameter. How do I convert this to a Vector for use in the fft function?

Please see attached.

Thankyou,

Mike.

Best answer by MikeArmstrong

Have a look at the attached.

I have used a pre-defined function to turn your range variable into a vector and also reduced fs to 512.

1 reply

1-Visitor
October 16, 2014

Have a look at the attached.

I have used a pre-defined function to turn your range variable into a vector and also reduced fs to 512.

mshaw-31-VisitorAuthor
1-Visitor
October 16, 2014

Brilliant thankyou.

I'm trying to implement a MATLAB FFT solution in MATHCAD. One quick question for anyone reading - using an fs value of 1000 I can run the FFT function within MATLAB but for MATHCAD I need to use either 512, 1024, etc. Why is this?

Thankyou.

23-Emerald V
October 16, 2014

Mike Shaw wrote:

Brilliant thankyou.

I'm trying to implement a MATLAB FFT solution in MATHCAD. One quick question for anyone reading - using an fs value of 1000 I can run the FFT function within MATLAB but for MATHCAD I need to use either 512, 1024, etc. Why is this?

Thankyou.

Because the Mathcad functions fft (, ifft, FFT and IFFT) assume vectors of length 2^m.

Use the functions cfft (,icfft, CFFT or ICFFT) instead - they allow arrays of arbitrary size.

Stuart