signal processing commands

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

Modérateur : xcasadmin

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

signal processing commands

Message par lukamar » sam. févr. 10, 2018 9:14 pm

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?
Pièces jointes
signalprocessing.zip
(7.99 Kio) Téléchargé 107 fois

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

Re: signal processing commands

Message par parisse » lun. févr. 12, 2018 9:54 am

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

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

Re: signal processing commands

Message par lukamar » lun. févr. 12, 2018 11:32 am

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.
Pièces jointes
signalprocessing-doc.zip
(5.06 Kio) Téléchargé 99 fois

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

Re: signal processing commands

Message par parisse » lun. févr. 12, 2018 1:01 pm

I have updated the unstable source. I plan to build 1.4.9-47 binaries before the end of the week.

frederic han
Messages : 1113
Inscription : dim. mai 20, 2007 7:09 am
Localisation : Paris
Contact :

Re: signal processing commands

Message par frederic han » mar. févr. 13, 2018 11:13 am

What is the difference between trigsimplify and tsimplify? Does trigsimplify stay with reals? could the doc explain it?

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

Re: signal processing commands

Message par parisse » mar. févr. 13, 2018 12:45 pm

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.

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

Re: signal processing commands

Message par lukamar » mar. févr. 13, 2018 10:05 pm

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.

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

Re: signal processing commands

Message par lukamar » ven. févr. 16, 2018 4:47 pm

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.

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

Re: signal processing commands

Message par lukamar » jeu. févr. 22, 2018 12:05 am

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).
Pièces jointes
signalprocessing-doc_fix1.zip
(3.2 Kio) Téléchargé 89 fois

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

Re: signal processing commands

Message par parisse » jeu. févr. 22, 2018 7:47 am

Thanks, fix applied in my source.

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

Re: signal processing commands

Message par lukamar » mer. sept. 19, 2018 9:22 am

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.
Pièces jointes
signalprocessing-fix2.zip
(204.65 Kio) Téléchargé 45 fois

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

Re: signal processing commands

Message par lukamar » mer. sept. 19, 2018 1:31 pm

Here is the documentation again, this time with images. The images should be put in the same directory as cascmd_en.tex.
Pièces jointes
signalprocessing-doc_fix2.zip
(88.57 Kio) Téléchargé 50 fois

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

Re: signal processing commands

Message par parisse » jeu. sept. 20, 2018 9:11 am

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.

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

Re: signal processing commands

Message par parisse » jeu. sept. 20, 2018 9:18 am

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.

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 10:00 am

Done! I hope I added the prefix to the image names correctly.
Pièces jointes
signalprocessing-doc_fix3.zip
(8.24 Kio) Téléchargé 49 fois

Répondre