cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

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

mshaw-3
1-Newbie

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

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.

1 ACCEPTED SOLUTION

Accepted Solutions
MikeArmstrong
5-Regular Member
(To:mshaw-3)

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.

View solution in original post

4 REPLIES 4
MikeArmstrong
5-Regular Member
(To:mshaw-3)

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.

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.

StuartBruff
23-Emerald II
(To:mshaw-3)

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

Great thankyou 🙂

Announcements