Re: [Scilab-users] spectrogram

2021-07-12 Thread Federico Miyara


The time-frequency representation implicit in the spectrogram has many 
uses apart from sound analysis, for instance ECG, EMG and EEG signals, 
mechanical vibration, light signals, seismic signals, sun spots, 
circadian rhythms, meteorology, etc.


Here I'm attaching a new version of the function spectrogram() that 
includes the possibility of choosing the color map, as in the updated 
version of mapsound() proposed by Samuel.


This function allows to choose directly the size of the FFT, the 
overlapping (in samples rather than in seconds), the sample rate, the 
type of windowing function, the type of graphic presentation, with 
linear or log distribution of the levels over the color map, either 
showing or not the reference color map, and the color map, either one of 
the standard ones introduced as a string or a custom one introduced as a 
three-column matrix. The output includes the numerical version of the 
spectrogram and, optionally, the time axis and frequency axis, allowing 
plotting it in a 3D version with plot3d() as well as postprocessing it 
(such as pitch or formant extraction).


I have made no attempt to include other spectrum algorithms apart from 
the FFT, or reassignment strategies, which could be a future improvement.


Regards,

Federico Miyara


On 12/07/2021 06:58, Claus Futtrup wrote:

Hi all

An Amplitude(time,frequency) plot should be named Spectrogram. That's 
the official name for it.


>mapsound(), which plots a spectrogram without numerical information

I didn't check, but if this is true, then an improvement as proposed 
by Federico would be good.


Best regards,
Claus

On 12-07-2021 11:38, Samuel Gougeon wrote:

Hello Federico,

As reported at http://bugzilla.scilab.org/16530 , mapsound() could 
not really be used.

It has been rewritten in Scilab 6.1.1.
It's help page in PDF is available at 
http://bugzilla.scilab.org/attachment.cgi?id=5178
To be compared to the last 6.1.0 former version 
https://help.scilab.org/docs/6.1.0/fr_FR/mapsound.html


It could be still improved later with additional suggested features.

Regards

Samuel

PS : A redirection mechanism to be set in user's preferences has been 
implemented in Scilab 6.1.1
to automatically redirect help queries in the help browser toward the 
most relevant page, as uman() does.
It has been designed first to help scilab newbies coming from other 
languages, but can also be used

for other common terms.
Even if it is not "standard", mapsound is explicit enough, in the 
right help section, and OK to me.

So we could redirect spectrogram to mapsound.

Le 12/07/2021 à 01:21, Federico Miyara a écrit :


Dear All,

I noticed there is no spectrogram function in Scilab that provides 
both graphic and numerical output. There is a function mapsound(), 
which plots a spectrogram without numerical information and without 
control over important aspects such has FFT length or windowing 
function. By the way, in the field of digital sound processing the 
usual name for this is spectrogram, not mapsound, which is a bit 
confusing.


I created a spectrogram() function. Even if it doesn't yet comply 
with the recommended style for Scilab functions (particularly 
regarding error handling or manual page), I think it might be useful 
for some users. I attach the function and a test script.


Regards,

Federico Miyara



___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users




___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users




--
El software de antivirus Avast ha analizado este correo electrónico en busca de 
virus.
https://www.avast.com/antivirus
function [z, t, f] = spectrogram(x, N, M, Fs, w, grph, cmap)
// Spectrogram of a signal
//
// Usage
//   [z, t, f] = spectrogram(x, N, Fs, M, w, grph)
// where
//   x:signal vector
//   N:FFT window length. Default: 1024
//   M:offset between FFT windows in samples
// Default: 512 
//   Fs:   sample rate in Hz. Default: 44100
//   w:windowing function; accepted values are
// "boxcar", "hann", "hamming", "blackman", 
// "bharris", "flattop" and a custom vector
// containing N components of the window.
// Default: "hann"
//   grph: graphic output; accepted values are
// "lin", "lincmap", "log", "logcmap",
// lin/log refers to linear or logarithmic
// distribution of magnitude along the
// colormap and cmap to the inclusion or 
// not of a colormap. The default is no
// graph.
//   cmap: a string indicating any of the accepted
// color maps (such as "jetcolormap") or 
// any matrix with 3 columns containing the
// 

Re: [Scilab-users] spectrogram

2021-07-12 Thread Claus Futtrup

Hi all

An Amplitude(time,frequency) plot should be named Spectrogram. That's 
the official name for it.


>mapsound(), which plots a spectrogram without numerical information

I didn't check, but if this is true, then an improvement as proposed by 
Federico would be good.


Best regards,
Claus

On 12-07-2021 11:38, Samuel Gougeon wrote:

Hello Federico,

As reported at http://bugzilla.scilab.org/16530 , mapsound() could not 
really be used.

It has been rewritten in Scilab 6.1.1.
It's help page in PDF is available at 
http://bugzilla.scilab.org/attachment.cgi?id=5178
To be compared to the last 6.1.0 former version 
https://help.scilab.org/docs/6.1.0/fr_FR/mapsound.html


It could be still improved later with additional suggested features.

Regards

Samuel

PS : A redirection mechanism to be set in user's preferences has been 
implemented in Scilab 6.1.1
to automatically redirect help queries in the help browser toward the 
most relevant page, as uman() does.
It has been designed first to help scilab newbies coming from other 
languages, but can also be used

for other common terms.
Even if it is not "standard", mapsound is explicit enough, in the 
right help section,  and OK to me.

So we could redirect spectrogram to mapsound.

Le 12/07/2021 à 01:21, Federico Miyara a écrit :


Dear All,

I noticed there is no spectrogram function in Scilab that provides 
both graphic and numerical output. There is a function mapsound(), 
which plots a spectrogram without numerical information and without 
control over important aspects such has FFT length or windowing 
function. By the way, in the field of digital sound processing the 
usual name for this is spectrogram, not mapsound, which is a bit 
confusing.


I created a spectrogram() function. Even if it doesn't yet comply 
with the recommended style for Scilab functions (particularly 
regarding error handling or manual page), I think it might be useful 
for some users. I attach the function and a test script.


Regards,

Federico Miyara



___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users



___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] spectrogram

2021-07-12 Thread Samuel Gougeon

Hello Federico,

As reported at http://bugzilla.scilab.org/16530 , mapsound() could not 
really be used.

It has been rewritten in Scilab 6.1.1.
It's help page in PDF is available at 
http://bugzilla.scilab.org/attachment.cgi?id=5178
To be compared to the last 6.1.0 former version 
https://help.scilab.org/docs/6.1.0/fr_FR/mapsound.html


It could be still improved later with additional suggested features.

Regards

Samuel

PS : A redirection mechanism to be set in user's preferences has been 
implemented in Scilab 6.1.1
to automatically redirect help queries in the help browser toward the 
most relevant page, as uman() does.
It has been designed first to help scilab newbies coming from other 
languages, but can also be used

for other common terms.
Even if it is not "standard", mapsound is explicit enough, in the right 
help section,  and OK to me.

So we could redirect spectrogram to mapsound.

Le 12/07/2021 à 01:21, Federico Miyara a écrit :


Dear All,

I noticed there is no spectrogram function in Scilab that provides 
both graphic and numerical output. There is a function mapsound(), 
which plots a spectrogram without numerical information and without 
control over important aspects such has FFT length or windowing 
function. By the way, in the field of digital sound processing the 
usual name for this is spectrogram, not mapsound, which is a bit 
confusing.


I created a spectrogram() function. Even if it doesn't yet comply with 
the recommended style for Scilab functions (particularly regarding 
error handling or manual page), I think it might be useful for some 
users. I attach the function and a test script.


Regards,

Federico Miyara


___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] spectrogram

2021-07-12 Thread Claus Futtrup


Thank you. :-)
BTW, Wikipeda has a nice (short) explanation of spectrogram:
https://en.wikipedia.org/wiki/Spectrogram

/Claus

On 12-07-2021 01:21, Federico Miyara wrote:


Dear All,

I noticed there is no spectrogram function in Scilab that provides 
both graphic and numerical output. There is a function mapsound(), 
which plots a spectrogram without numerical information and without 
control over important aspects such has FFT length or windowing 
function. By the way, in the field of digital sound processing the 
usual name for this is spectrogram, not mapsound, which is a bit 
confusing.


I created a spectrogram() function. Even if it doesn't yet comply with 
the recommended style for Scilab functions (particularly regarding 
error handling or manual page), I think it might be useful for some 
users. I attach the function and a test script.


Regards,

Federico Miyara



 
	Libre de virus. www.avast.com 
 



<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users



___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users