JuliaApproximation / FrameFun.jl

Exploring practical possibilities of approximating functions with frames rather than with a basis
Other
23 stars 7 forks source link

Automatic construction of a `framefun` with a reasonably optimal length #3

Closed kuanxu closed 7 years ago

kuanxu commented 8 years ago

Is it possible to have an automatic framefun constructor which is able to construct a framefun with a reasonably optimal length n for a given function handle? I mean something similar to the chebfun constructor which keeps increasing the length of the approximation until the function is "fully resolved".

I had a vague impression that @daanhb mentioned that the Fourier extension coefficients are not necessarily decaying, which prevents an automatic construction. But I checked with a few examples and found that the Fourier extension coefficients are indeed getting smaller and smaller as the frequency goes higher and higher. Any comments?

It'll be nice if we can have such an auto-ctor. But, of course, even if it is possible to have such a thing, I'm not suggesting this should be something default at the user level.

daanhb commented 8 years ago

Sorry for my slow reply @kuanxu. This is a very good point, and as you mention the adaptive construction of a frame approximation is not straightforward. It is a topic of its own that we did not address yet. Feel free to experiment and suggest possible solutions :-)

For completeness, let me outline some considerations:

kuanxu commented 8 years ago

@daanhb Thanks for so much detail!!

To item 3:

  1. IIUC, you mean the cost for getting a smoothed FE is O(N(logN)^2) + O(NlogN)?
  2. Can you give a pointer to the snippet in the current code where smoothing is implemented?
daanhb commented 8 years ago

Yes, the cost of smoothing is the same as that of the regular approximation, O(N(logN)^2). For an example, @kuanxu, have a look at examples/Smoothing.ipynb. The 2D code seems to be failing currently, but the 1d examples should be okay and they show you the syntax to use.

daanhb commented 7 years ago

There is now a preliminary adaptive constructor in the code, see the example notebook for syntax. We will be working on improving this in the future.

kuanxu commented 7 years ago

@vincentcp and @daanhb Bravo!! This is what we have been screaming for. Will play more with the feature soon!