Page 1 sur 3

signal processing commands

Publié : sam. févr. 10, 2018 9:14 pm
par lukamar
Hello Bernard, I have some new commands for Giac that I would like to share. Since there are already fft, readwav, writewav, playsnd and descriptive statistic commands in Giac, I implemented a few more (mainly based on fft algorithm): cross_correlation, auto_correlation, convolution, lowpass (filter), highpass (filter), threshold (for performing thresholding operations on a list) and a bunch of classical window functions (see the tex file for details). All the mentioned commands, taken together, form a basic signal processing toolbox. Also, this addition covers for 21 Maple commands when it comes to compatibility. Could these commands be added to Giac?

Re: signal processing commands

Publié : lun. févr. 12, 2018 9:54 am
par parisse
Great, thank you!
What should be added in giac-1.4.9/doc/aide_cas for the short online help?
The format is
# commandname
2 english short online help
0 syntax
-1 1st see also command
-2 2nd see also command
...
example1
example2

Re: signal processing commands

Publié : lun. févr. 12, 2018 11:32 am
par lukamar
Thanks, the short help is below (containing also missing entries for domain, trigsimplify, nlpsolve and triginterp). Also I sent you the signalprocessing.tex file again with few typos corrected and examples added for lowpass and highpass.

Re: signal processing commands

Publié : lun. févr. 12, 2018 1:01 pm
par parisse
I have updated the unstable source. I plan to build 1.4.9-47 binaries before the end of the week.

Re: signal processing commands

Publié : mar. févr. 13, 2018 11:13 am
par frederic han
What is the difference between trigsimplify and tsimplify? Does trigsimplify stay with reals? could the doc explain it?

Re: signal processing commands

Publié : mar. févr. 13, 2018 12:45 pm
par parisse
trigsimplify handles only trig functions. tsimplify means transcendental simplification, it minimizes the number of transcendental functions so that all remaining functions in the expression should be algebraically independant.

Re: signal processing commands

Publié : mar. févr. 13, 2018 10:05 pm
par lukamar
I wrote some documentation on trigsimplify for cascmd_en.tex:

Code : Tout sélectionner

\subsection{Simplify trigonometric expressions : {\tt trigsimplify}}\index{trigsimplify}
\noindent{\tt trigsimplify} simplifies trigonometric expressions 
by combining {\tt simplify}, {\tt texpand}, {\tt tlin}, {\tt tcollect}, {\tt trigsin}, {\tt trigcos} and {\tt trigtan} commands in a certain order.\\
Input :
\begin{center}{\tt trigsimplify((sin(x+y)-sin(x-y))/(cos(x+y)+cos(x-y)))}\end{center}
Output :
\begin{center}{\tt tan(4*x/3)}\end{center}
Input :
\begin{center}{\tt trigsimplify(1-1/4*sin(2a)\verb|^|2-sin(b)\verb|^|2-cos(a)\verb|^|4)}\end{center}
Output :
\begin{center}{\tt sin(a)\verb|^|2-sin(b)\verb|^|2}\end{center}
It can be inserted immediately after tsimplify section.

Re: signal processing commands

Publié : ven. févr. 16, 2018 4:47 pm
par lukamar
Actually, maybe it's better (for future versions) to move the cascmd_en entry for trigsimplify in Trigonometry section (5.21), it would make more sense and it would probably be more visible.

Re: signal processing commands

Publié : jeu. févr. 22, 2018 12:05 am
par lukamar
I have corrected couple of typos, in lowpass/highpass examples the amplitude is 214 and it is meant to be 2^14 (now proper \verb command is added around ^ in the tex source).

Re: signal processing commands

Publié : jeu. févr. 22, 2018 7:47 am
par parisse
Thanks, fix applied in my source.

Re: signal processing commands

Publié : mer. sept. 19, 2018 9:22 am
par lukamar
Hello,
I have some updates:
* Since Giac supports reading, writing and playing back WAV files, I made several simple commands to ease the manipulation with wav data. These are createwav, stereo2mono, channels, bit_depth, samplerate, duration, channel_data, resample, plotwav and plotspectrum (see the doc update for descriptions). Now wav data can be easily inspected, generated and visualized. Previously it was not immediately clear what to do with unsigned data obtained by readwav as well how to export data to a WAV file. This is all at cost of about 500 lines more in signalprocessing.cc.
* Resampling is done using libsamplerate (samplerate.h, the package libsamplerate0-dev in Debian provides it). It is optionally included, the switch is HAVE_LIBSAMPLERATE.
* There are few more improvements for old commands and the documentation is updated. I enclosed the tex file in doc directory, it should be pasted over the Signal Processing section. It now contains one more section, Audio Tools.
* in doc directory there is also an updated aide_cas file. It contains the new commands as well as some changes for the graph theory commands.

Re: signal processing commands

Publié : mer. sept. 19, 2018 1:31 pm
par lukamar
Here is the documentation again, this time with images. The images should be put in the same directory as cascmd_en.tex.

Re: signal processing commands

Publié : jeu. sept. 20, 2018 9:11 am
par parisse
Thanks! More sound support will certainly be a welcomed addition!
I have renamed the png files with the same prefix : sound. This make handling easier in Makefile.am.

Re: signal processing commands

Publié : jeu. sept. 20, 2018 9:18 am
par parisse
By the way, could you add \index{commandname} on sections describing a commandname, e.g. \index{readwav} for the readwav command? That way, clicking on Details from short help will launch the browser.

Re: signal processing commands

Publié : jeu. sept. 20, 2018 10:00 am
par lukamar
Done! I hope I added the prefix to the image names correctly.