You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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):
gr();
B = Fourier(61) → -1..1
D = -0.5..0.5
f = x->x
F = Fun(f,B,D)
plot(F,layout = 2)
p = plot!(F,f,subplot=2)
display(p)
readline()
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:
gr();
B = Fourier(61) → -1..1
D = -0.5..0.5
f = x->x
F_ = Fun(f, B, D)
F = expansion(B, F_.coefficients)
plot(F,layout = 2)
p = plot!(F,f,subplot=2)
display(p)
readline()
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?
The text was updated successfully, but these errors were encountered:
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:
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?
The text was updated successfully, but these errors were encountered: