How to Implement FFT and Linear Optimization in C++?

  • C/C++
  • Thread starter orstats
  • Start date
  • Tags
    C++ Fourier
In summary, the individual is looking for a tutorial on how to write and run their own functions in C++, specifically for the purpose of computational estimation. They are familiar with MATLAB but are looking for alternatives. The expert recommends using existing libraries for FFT, inversion, and linear optimization algorithms rather than coding them from scratch. The libraries suggested include fftw, BLAS, LAPACK++, and ACML (if using an AMD chipset). The individual also inquires about using Intel's MLK library, but it is not compatible with the Borland compiler. The expert advises that the individual's input function for FFTW should be stored in an array, regardless of whether it involves a summation or not. They also suggest using MS C++ Visual Studio or
  • #1
orstats
14
0
Dear All:

I am finding that for the computational estimation that I need, I would not be able to do this in MATLAB. Is there a good tutorial that you would recommend for writing and running our own functions, such as inversion of fast Fourier transforms and linear optimization, in C++?


Thanks so much!
 
Technology news on Phys.org
  • #2
I would not recommend writing your own FFT, inversion, or linear optimization algorithms. (unless of course it is required for a class). There are lots of libraries available to do those in C++ that will probably be much better than anything you would code yourself.
 
  • #3
Ok, sounds encouraging. Which ones are they? Or is there a repository that I can look at? I am more familiar w. MATLAB. When I last programmed in C, I don't remember libraries we had access to other than the standard simple math functions. Does C++ offer more libraries then? Please kindly point where I may locate these libraries. The compiler is Borland 5.5...does that make a difference in the libraries I have available from the free download?
 
  • #4
orstats said:
Or is there a repository that I can look at?
Uhh, Google?

Sorry, just teasing.

I would recommend the fftw library (fastest Fourier transform in the west) for a really good set of FFT algorithms as well as being my favorite name of any library I know :smile:. For linear algebra functions probably BLAS or LAPACK++ will be sufficient. If you are running on an AMD chipset then you could look at the ACML which has BLAS, LAPACK, FFT, random number generators, and basic math functions all in one package. I am sure that Intel has a similar library, but I haven't used it.
 
Last edited:
  • #5
Thanks! I am running Intel Pentium duo-Core. I will check if they have these libraries. FFTW library won nice accolades. We are interested in the fwrd FT of this function at specific values of k. In our case, to be Fourier transformed function Xj is a complex expression that is a ratio of trig functions of i*sqrt(j). Being that my Xj is a function of the index j of the discrete summation I am not sure how this can be written as input for FFTW...
 
  • #6
FYI: Intel also has MLK...its compiler compatibility is limited to MS C++ Visual Studio and Intel C++ Compiler and GCC. No Borland it looks like.
 
  • #7
orstats said:
Being that my Xj is a function of the index j of the discrete summation I am not sure how this can be written as input for FFTW...
The FFT always takes an array (of complex numbers) as an input. So simply compute the value of your input function and store it in an array. It doesn't matter if computing your function involves a summation or not.
 
  • #8
orstats said:
FYI: Intel also has MLK...its compiler compatibility is limited to MS C++ Visual Studio and Intel C++ Compiler and GCC. No Borland it looks like.
Typical of Microsoft.
 
  • #9
DaleSpam said:
Typical of Microsoft.
To be fair, I recall that the Borland compilers have generally been lagging behind others in its support of more advanced C++ features.
 
  • #10
Okay, great. Which is better to download for compiler: MS C++ Visual Studio vs. Intel C++ Compiler when we're running on MS XP Duo-Core?
 

Related to How to Implement FFT and Linear Optimization in C++?

1. What is Fast Fourier Borland C++?

Fast Fourier Borland C++ is a programming library that implements the Fast Fourier Transform algorithm, which is used for efficient and accurate computation of the Discrete Fourier Transform. It is commonly used in signal processing, image processing, and other scientific and engineering applications.

2. How does Fast Fourier Borland C++ work?

Fast Fourier Borland C++ uses the Cooley-Tukey algorithm to divide the DFT into smaller sub-problems, which can be solved recursively. This allows for a significant reduction in computation time compared to the standard DFT algorithm.

3. What are the advantages of using Fast Fourier Borland C++?

One of the main advantages of using Fast Fourier Borland C++ is its speed. It can compute the DFT of a signal or image much faster than other methods, making it ideal for real-time applications. Additionally, it is highly accurate and can handle large data sets with ease.

4. Can Fast Fourier Borland C++ be used for any type of signal or image?

Yes, Fast Fourier Borland C++ can be used for any type of signal or image, as long as it is in a digital format. This includes audio, video, and other types of data that can be represented as a discrete sequence of values.

5. Is Fast Fourier Borland C++ difficult to learn?

Like any programming language or library, there is a learning curve involved in using Fast Fourier Borland C++. However, with some basic knowledge of C++ and signal processing, it is not overly difficult to pick up and start using. There are also many online resources and tutorials available to help beginners get started.

Similar threads

  • Programming and Computer Science
Replies
2
Views
1K
  • Programming and Computer Science
Replies
8
Views
868
  • Programming and Computer Science
3
Replies
81
Views
5K
  • Differential Equations
Replies
11
Views
2K
  • Programming and Computer Science
Replies
2
Views
2K
  • Programming and Computer Science
Replies
5
Views
2K
  • Programming and Computer Science
Replies
1
Views
964
  • Programming and Computer Science
Replies
17
Views
4K
  • Programming and Computer Science
Replies
30
Views
4K
  • Programming and Computer Science
Replies
5
Views
637
Back
Top