signal processing commands

Librairie C++ de calcul formel/ C++ symbolic computation library

Modérateur : xcasadmin

parisse
Messages : 5084
Inscription : mar. déc. 20, 2005 4:02 pm
Contact :

Re: signal processing commands

Message par parisse » jeu. sept. 20, 2018 12:09 pm

Sorry, I should have been more precise, I added sound_ as prefix, not sound, please replace {sound by {sound_

[Edit] Details now works!
I think it's time to release a 1.5.0-3, I hope tomorrow.

lukamar
Messages : 294
Inscription : ven. juin 30, 2017 9:55 am
Localisation : Zagreb, Croatia

Re: signal processing commands

Message par lukamar » jeu. sept. 20, 2018 12:20 pm

No problem, here's the corrected file.
Pièces jointes
signalprocessing-doc_fix4.zip
(8.24 Kio) Téléchargé 56 fois

symphorien
Messages : 2
Inscription : mer. oct. 04, 2017 8:02 pm

Re: signal processing commands

Message par symphorien » sam. déc. 08, 2018 7:58 pm

When building giac 1.5.0-21 with libsamplerate 0.1.9 and gcc 7.3 I get this error:

Code : Tout sélectionner

signalprocessing.cc: In function 'giac::gen giac::_resample(const giac::gen&, const giac::context*)':
signalprocessing.cc:637:77: error: assignment of read-only location '*(data.SRC_DATA::data_in + ((sizetype)(((long unsigned int)((i * nc) + j)) * 4)))'
             data.data_in[i*nc+j]=_evalf(chdata[j][i],contextptr).DOUBLE_val();
                                                                             ^
maybe because data.data_in is declared as a const float*.

lukamar
Messages : 294
Inscription : ven. juin 30, 2017 9:55 am
Localisation : Zagreb, Croatia

Re: signal processing commands

Message par lukamar » lun. déc. 10, 2018 4:38 pm

Indeed, const was missing in version 0.1.8. It's not data_in that should be allocated but a temporary float* instead. I'll fix that.

lukamar
Messages : 294
Inscription : ven. juin 30, 2017 9:55 am
Localisation : Zagreb, Croatia

Re: signal processing commands

Message par lukamar » lun. déc. 10, 2018 10:29 pm

I committed a fix in my source at github here: https://github.com/marohnicluka/giac (the changed file is signalprocessing.cc, but the last revision also contains some fixes to graph theory manual and graphtheory.cc).
It should work now.

parisse
Messages : 5084
Inscription : mar. déc. 20, 2005 4:02 pm
Contact :

Re: signal processing commands

Message par parisse » mer. déc. 12, 2018 10:03 am

Hi!
You forgot to remove the code parts that are now in desolve.cc
cascmd_en.tex has changed, with the addition of Jay new 2d graphic section, I have merged the 2 files. Same for aide_cas.
Unstable tarball updated.

lukamar
Messages : 294
Inscription : ven. juin 30, 2017 9:55 am
Localisation : Zagreb, Croatia

Re: signal processing commands

Message par lukamar » jeu. déc. 13, 2018 8:00 pm

Indeed, thanks for the reminder! I have updated my source just now (optimization .cc/.h, cascmd_en.tex, aide_cas). Please let me know if there's anything else to update.

parisse
Messages : 5084
Inscription : mar. déc. 20, 2005 4:02 pm
Contact :

Re: signal processing commands

Message par parisse » sam. déc. 15, 2018 6:35 am

Everything seems synchronized, thanks!

lukamar
Messages : 294
Inscription : ven. juin 30, 2017 9:55 am
Localisation : Zagreb, Croatia

Re: signal processing commands

Message par lukamar » jeu. janv. 24, 2019 4:57 pm

Hello,
I fixed several examples for some of my commands in aide_cas, there were some leading spaces missing so they weren't pasted correctly when clicked on. Fixes committed to my source.

lukamar
Messages : 294
Inscription : ven. juin 30, 2017 9:55 am
Localisation : Zagreb, Croatia

Re: signal processing commands

Message par lukamar » ven. août 30, 2019 6:55 pm

Hello Bernard,
I have coded some new commands for signal processing:
1. boxcar, rect (rectangular function), tri (triangular function) and sinc (cardinal sine function), since they are often used;
2. fourier and ifourier, which compute continuous Fourier transforms;
3. convolution command can now accept real functions too, in which case it computes continuous convolution by integrating over the real line.
To enable computing Fourier transforms of unknown functions, I have added the command addtable which allows storing Fourier/Laplace transform pairs, such as f(x) -> F(s). I will also try to modify laplace command in that respect.
Changed files are signalprocessing.cc/h.
The updated aide_cas and cascmd_en.tex are in doc directory. I have put entries for fourier/ifourier in the "Fourier Transformation" chapter, the other commands are described in "Signal processing".
Finally, I have fixed some more bugs in extrema command, it is now prone to segfaults. Please update optimization.cc too.

parisse
Messages : 5084
Inscription : mar. déc. 20, 2005 4:02 pm
Contact :

Re: signal processing commands

Message par parisse » sam. août 31, 2019 10:55 am

Thanks! It's now integrated in giac unstable.

lukamar
Messages : 294
Inscription : ven. juin 30, 2017 9:55 am
Localisation : Zagreb, Croatia

Re: signal processing commands

Message par lukamar » sam. août 31, 2019 5:16 pm

Thank you! I have just added two more files in my repository, markup.cc/h. These contain routines for exporting to LaTeX and to presentation/content MathML. I'm aware that these features already exist in Giac, but I tried to improve them. These routines try to export to standard mathematical notation and typesetting whenever possible, keeping usage of parentheses at minimum. Could you please include these files to the Giac source tree in unstable version (I don't know how to do it) and use export_latex routine in _latex command (tex.cc) for inputs other than graphics and spreadsheets? That way I could easily test these algorithms and fix bugs if any.
Some details:
1. export_latex produces a string representing a math expression in LaTeX. amsmath and amssymb are required to typeset it. Using it as the standard LaTeX export would improve typesetting for interactive sessions in TeXmacs, for example.
2. export_mathml_presentation should work as an improved version of _mathml routine.
3. export_mathml_content exports to content MathML using OpenMath content dictionaries when possible. This could help applications which communicate with Giac through pipes to understand Giac expressions.
4. export_mathml produces a MathML block containing:
<semantics><PRESENTATION MATHML><annotation-xml><CONTENT MATHML></annotation-xml><annotation><GIAC PRINT></annotation></semantics>

parisse
Messages : 5084
Inscription : mar. déc. 20, 2005 4:02 pm
Contact :

Re: signal processing commands

Message par parisse » dim. sept. 01, 2019 10:00 am

Could you replace front() and back() call on strings with [0] and [s.size()-1]? Otherwise it does not compile with old gcc.

parisse
Messages : 5084
Inscription : mar. déc. 20, 2005 4:02 pm
Contact :

Re: signal processing commands

Message par parisse » dim. sept. 01, 2019 10:13 am

For inclusion in _latex, the best is probably that you declare a function returning false if you have some unsupported object (like a symbolic of sommet at_pnt), something like
bool has_improved_latex_export(const gen &g, string & s, GIAC_CONTEXT);
then I can insert in latex
...
if (has_improved_latex_export(g,s,contextptr)) return gen2string(s,false);
// old code
return string2gen(gen2tex(g,contextptr),false);

lukamar
Messages : 294
Inscription : ven. juin 30, 2017 9:55 am
Localisation : Zagreb, Croatia

Re: signal processing commands

Message par lukamar » dim. sept. 01, 2019 8:10 pm

Done! I have also renamed markup.cpp to markup.cc.

Répondre