- #1
confused_engineer
- 39
- 2
- TL;DR Summary
- I am having trouble since I need to use too many terms to reproduce what I am looking for.
Hello everyone. I am working with mathematica, where I have developed a two-dimensional shannon interplation, just as can be seen in the slides 15 to 18 of this presentation. The code is as follows:
Unfortunately, if I use the attached data, I need an unreasonably long number of terms to propperly reproduce the wind that I am delaing with.
Can someone please recommend me an alternative to this Shannon interpolation so that I would get a better result using fewer terms?
EDIT: Since I cannot upload the data as .nb, for the mathematica file and .mat for the data, I have tried to convert them to text files just in case it can be useful.
Any answer is appreciated.
Thanks for reading.
Best regards.
confused_engineer.
Shannon interpolation:
savedX = Table[XposX = mat[[All, 1]]; YposX = mat[[All, 2]];
windXVal = mat[[All, i]];
windXMat = Transpose[{XposX, YposX, windXVal}];
ifuncEPSX = Interpolation[windXMat //. {x_List} :> x];
intDataVectorEPSX =
Flatten[Table[{t, u, ifuncEPSX[t, u]}, {t, xmin, xmax,
dDeltaXwX}, {u, ymin, ymax, dDeltaYwX}]];
leEPSX = Length@intDataVectorEPSX;
vectorXintEPSX =
Table[intDataVectorEPSX[[i]], {i, 1, leEPSX - 2, 3}];
vectorYintEPSX =
Table[intDataVectorEPSX[[i]], {i, 2, leEPSX - 1, 3}];
vectorFintEPSX = Table[intDataVectorEPSX[[i]], {i, 3, leEPSX, 3}];
interpolatedDataEPSX =
Transpose[{vectorXintEPSX, vectorYintEPSX, vectorFintEPSX}];
shannonInterpolationWindX[alpha_, beta_] =
Total[#3*sinc[(alpha - #1)/dDeltaXwX]*
sinc[(beta - #2)/dDeltaYwX] & @@@ interpolatedDataEPSX], {i,
3, countMax + 2}];
ContourPlot[
shannonInterpolationWindX[t, u], {t, xmin, xmax}, {u, ymin, ymax},
GridLines -> {{xmax, xmin}, None}, PlotLegends -> Automatic]
Can someone please recommend me an alternative to this Shannon interpolation so that I would get a better result using fewer terms?
EDIT: Since I cannot upload the data as .nb, for the mathematica file and .mat for the data, I have tried to convert them to text files just in case it can be useful.
Any answer is appreciated.
Thanks for reading.
Best regards.
confused_engineer.
Attachments
Last edited: