Open jagunther opened 1 year ago
Hi @jagunther, sorry for the slow reply here!
It seems we haven't updated the front page in a while. Indeed, somewhere along the way we changed the way plotting an "extension frame" works. It only shows the part of the approximation that actually approximates the given function (here the interval [-0.5,0.5]) and nothing outside.
The reason your plot on the extension [-1,1] differs from the one on the front page is because the extension is not unique. The "Fourier extension problem" is in fact solved using randomized linear algebra, hence you might even get a different result every time. It should always approximate the given function f on [-0.5,0.5] to high accuracy however.
About plotting the extension: at one point we had a plot_extension=true
optional argument, but that seems to have disappeared. In your plotting example you manually create a Fourier basis, rescaled to the interval [-1,1]. This is implicit in the dictionary
(more general than a basis) of the expansion F
:
julia> dictionary(F)
(-0.5..0.5) → (Fourier(61) → (-1.0..1.0))
julia> superdict(dictionary(F))
Fourier(61) → (-1.0..1.0)
It would be slightly neater if we defined, say,
super(F::Expansion) = Expansion(superdict(dictionary(F)), coefficients(F))
then you could simply write plot(super(F))
.
Hi!
First of all: Thanks a lot for making your code available :)
I want to implement 1D Fourier-extension of some functions and came across this library last week. I did a fresh install of Julia and the FrameFun, BasisFunctions and DomainSets packages. The first thing I did was to run the example code from the front-page (I run it as a script from the command-line):
However, contrary to the plot on the front-page, the resulting function is only plotted in the inner interval, see figure attached.
I did the following to get the approximation on the whole interval:
with the result
This looks better, but it is not the same result as I see on the front-page.
What do I need to change?