Help on making MULTIRESOLUTION WAVELET ANALYSIS available ?

Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.
Two questions for all of you that know much better than me this topic.
1. as the impulse reponse (vs. time) can be determine by the FT of the pressure (vs. frequancy) (am I right ?), is it possible to get a spectrogram starting from pressure (vs. frequency) ?
2. if the respinse is yes, is there any esplanation on how to do that ? please don't point me any (closed) tool or some code in Matlab: me, I can use Mathcad and Mathematica (I would like to get the same results using those tools) and I don't fear at all even advanced mathemathics (but I don't want to spend the next two years in studying the topic.
Many thanks
 
Hello,


In the Hornresp thread, in the message:

http://www.diyaudio.com/forums/subwoofers/119854-hornresp-109.html#post2167471

I proposed to write for the Hornresp software a spectrogram routine inspired by my quasi wavelets routine.
As Hornresp is written in Visual Basic and as we had to keep run time acceptable I had to modified deeply my quasi wavelets routine written in Matlab language. The original gaussian type Fourier window could not be used anymore so I used a simpler window and, with some further optimization the resulting spectrogram brings the same information as the original quasi wavelets graph with very few artifacts due to the used window.

I have to thanks David Mc Bean who accepted to included the routine in Hornresp version 27.00. Read his message:

http://www.diyaudio.com/forums/subwoofers/119854-hornresp-123.html#post2217011

Hornresp version 27.00 is now downloadable for free at:

Telstra BigBlog -


Best regards from Paris, France

Jean-Michel Le Cléac'h
 
Hello,

The spectrogram in Hornresp has been improved.

The new calculation runs faster and the quality of the spectrogram is much better due to the use of a new Fourier window equivalent to a gaussian window.

See David McBean's message:

http://www.diyaudio.com/forums/subwoofers/119854-hornresp-128.html#post2223790

A test spectrogram is attached to this message

Best regards from Paris, France



I have to thanks David Mc Bean who accepted to included my spectrogram routine in Hornresp version 27.00. Read his message:

http://www.diyaudio.com/forums/subwoofers/119854-hornresp-123.html#post2217011

Hornresp version 27.00 is now downloadable for free at:

Telstra BigBlog -


Best regards from Paris, France

Jean-Michel Le Cléac'h
 

Attachments

  • Spectrogram_HR.gif
    Spectrogram_HR.gif
    62.8 KB · Views: 269
Hello,

I modified my (continuous) wavelets transform Matlab routine in order to not use the "gauspuls" function (not available in Octave and Scilab).

You'll find in attached file the new routine

The gaussian enveloppe wavelet pulse is calculated from line 98 to 102

(a ratio bandwith/center frequency of .7 is used).

I think this routine will be easily translated in Scilab or in Octave.

The default parameters for the analysis are set to analyse the pulse response of a horn, a medium loudspeaker or a tweeter. You can adapt the parameters to your need on lines 45 to 49.

For bass loudspeakers a minimum frequency ( fmin ) value of 20 (Hz) may be used but in that case the time limit ( tmax ) of the signal window should be increased (e.g. : tmax = 0.025 ). Please notice that tmax is expressed in seconds not in miliseconds.


Best regards from Paris, France

Jean-Michel Le Cléac'h
 

Attachments

  • Wavelets_JMLC.txt
    5.6 KB · Views: 57
Hi

Latest version of WTF package now ready for download :

http://www.kinotechnik.edis.at/pages/diyaudio/wavelet/mige0_start_wavelet_ver_1_6.zip




Final routine from Jean-Michel integrated – works like a charm.
No need for additional gauspuls file for Jean-Michel spectrogram analysis.

New integrated 3-D plots of Elias look great – way more detailed and informative than usual CSD / waterfall :


3-D_subsequent_reflections.png


3-D_wavelet_honker.png





Original files of Elias and Jean-Michel are included in the package for documentation and to simplify own modifications.
Also a standalone version for both are included ""wtf-pekonen_stand_alone.m" and wtf-jmlc_stand_alone.m which should run with no further modification for demonstration purpose, analysing the ir_file.wav included.



A detailed “HowTo” can be found in the readme.txt included:

Code:
README for WTF-Package - the first free wavelet software package having become available.

Special thanks to Elias Pekonen, Jean-Michel LeCleach and Jacques Lewalle as main contributors !


****************************************************************************************
****************************************************************************************

To update an existing WTF - Package download new version > unzip it into a new folder > set Octave path to the new folder > delete Octave path to old folder > have fun !  

****************************************************************************************

If you are new to WTF - Package > read the following HowTo:

****************************************************************************************
****************************************************************************************


To install Octave on windows

1.) download and install
Octave-3.2.4_i686-pc-mingw32_gcc-4.4.0_setup.exe (or subsequent versions)

2.) download and install
Xoctave_setup 0.9.92.exe (or subsequent versions)

3.) Start XOctave

4.) on first call Xoctave tells you the Octave path is not assigned
>> view >> options >> console >> "where is Octave"
enter your path to Console software (most probably: "C:\Octave\3.2.4_gcc-4.4.0\bin\octave.exe")

5.) download DIY_wavelet_Package and unpack 
 place folder "mige0_start_wavelet_ver_xx" to wherever you like

6.) tell Octave the path where your files are to be found
>> view >> path >>
enter your path to "mige0_start_wavelet_ver_xx" folder and press "Add Path"
check if your path to "mige0_start_wavelet_ver_xx" has been assigned by pressing "Update"



now  >> view >> Console >> and you are ready to go under Windows !



################

To install Octave under Ubuntu, its already listed under "Software" and you can install comfortably both Octave and QtOctave from there.

You do not have to tell QtOctave where to find Octave but you have to tell QtOctave where to find "mige0_start_wavelet_ver_xx" folder of course.

Finally set cursor to "  console  " and you are ready to go under Linux !



################



type in "start_wavelet" and follow the user menu - or - check out "waveletdemo" or "wtf_pekonen_stand_alone" from Elias Pekonen or "wtf_jmlc_stand_alone" from Jean-Michel LeCleach

For convenience I have added "ir_file.wav" a testfile with subsequent reflections (-6dB 1ms) and "honker.wav" file from my 0-deg honker - so you can go through the menu to check out WTF Package easily.

If you are going to analyse your own IR files, you either have to place it in the "mige0_start_wavelet_ver_xx" folder, or you have to add an additional path to your preferred directory.




****************************************************************************************
****************************************************************************************

Navigating through the Diy_Audio_WTF  (Wavelet Audio Analysis) package:

****************************************************************************************


>>>  start_wavelet

will start the WTF package and you will bring up the intro and in the first menu you will be  ask to choose between 

- normal operation
- change current user settings
- debug operation
- EXIT current run

I recommend to use "normal operation" unless you face unexpected problems.
"change current user settings" will alllow you to chose individual settings for : 
	"proceed without changing current settings" to jump back from sub menue
	"time after peak" to calculate and plot
	"min frequency" to calculate and plot
	"dB range" to calculate and plot
	"load default settings" in case you got lost
	"EXIT" current run

"debug operation" gives you additional information on what functions are called and have processed successfully. So this is a handy tool to post a simple screenshot in case something went wrong.

################

in next menu you will be asked to select an impulse response file.

You can just press enter to select the default file "ir_file.wav" (first time usage) or the file of your last run - or - type in the name of your file.
Its best to avoid spaces and any special characters for your impulse response file.
Also the file has to be located where it can be found by octave - meaning - you either can put it into the "mige0_start_wavelet_ver_xx" folder, or you set an additional path to your preferred folder.

################

There is automatic file extension detection for *.wav files

If there is no *.wav file extension present, then in the next menu you will be asked to select an impulse response file type.

As for now the package can process different file types:

	32 bit or 16 bit WAV file
	ARTA txt file
	two column TEXT file
	one column TEXT file
	CLIO mls file ( experimental )
	"EXIT" current run

in case of "ascii two column text file" it is assumed that the first column contains the time and the second column contains the amplitude of your impulse response.

in case of "ascii one column text file" it is assumed that the first and only column contains the amplitude of your impulse response and you will be asked to enter the sample rate in a sub menue.

################

in next menu you will be asked to select wavelet analysis type.

As for now the package can process different typs of wavelet analysis: 

	Multi-Resolution Wavelet Analysis (by Elias Pekonen)
	Wavelet Analysis (by Jean-Michel Le Cleac'h)
	Multi-Resolution Wavelet Analysis by Morlet / Jaques Lewalle style (experimental)
	Wavelet Analysis by Morlet / Jaques Lewalle style (experimental)
	"EXIT" current run

################

The first plot popping up after the third menu will display the raw impulse response from 0 to 100ms

The second plot popping up after the fourth menu will display the normalized impulse response from peak to whatever display time that is selected 

The next plots popping up will display the wavelet analysis according to the analysis settings chosen 


################

Between the menus additional information is displayed that you may you find interesting and helpful.
If you quit by "EXIT" in menu, you have to reconnect Xoctave to Octave.
Be warned that for one reason or another, the plots are pretty slow when you work under Windows.



****************************************************************************************
****************************************************************************************


Hope you have fun with the first free wavelet software package having become available, aimed for wavelet audio analysis to the "non-math-head" user.


You can download the full package here:  

http://www.kinotechnik.edis.at/pages/diyaudio/wavelet/mige0_start_wavelet_ver_1_6.zip
All files of the package are listed in "content.txt"

Any feedback is welcome at diyaudio (thread: "help-making-multiresolution-wavelet-analysis-available"):
http://www.diyaudio.com/forums/software-tools/163473-help-making-multiresolution-wavelet-analysis-available.html


:)

keep swingin'
Michael Gerstgrasser


Have fun !
Michael
 
Last edited:
Thank you Michael!

How about including ARTA .pir file?

Here I have a Octave script to convert ARTA exported .pir binary impulse response file to .wav file.
http://dl.dropbox.com/u/2400456/html/Elias Pekonen/Wavelet Software.html

If you have ARTA maybe you could check how it works?

- Elias


Elias
your conversion from *.pir to *.wav works nice !


here is the new version of the WTF Package which has auto-detect for ARTA *.pir files included

http://www.kinotechnik.edis.at/pages/diyaudio/wavelet/mige0_start_wavelet_ver_1_7.zip


Michael
 
Hello Michael,

I ran 1.7 packet. Good news and bad news :D

First, I use Octave 3.0.3. And I don't have Xoctave, just the command line interface :D

Here is some observations I came across:


1) start_wavelet.m encounters error. This is due to clf() function, as it assumes zero input arguments, but in code there is number argument given. There is no need to enter a argument, as clf() is used after the figure() and it points to that specific figure alone. This is a backwards compatibility issue. After I removed the argument from clf() I had succesful run :)


2) Default fonts. My system cannot find the correct font (this problem I've allways had with various Windows machines). I overcome this by entering the command set(0, 'defaulttextfontname', '*'); Whitout this output looks messy (see pic).


3) Suggestion: We really need to improve the UI. NO manual writing of the IR file name, please :). Maybe we can work over this one, I have some ideas.


4) IR file names. It is possible to have any type of file name with white spaces and special characters. Any file name good for Windows is good for Octave. Use '' or "" around the filename.


5) 3D plotting. In my multiresolution wavelet I use downsampling along the time axis (parameter Nds) and it works well with that particular wavelet type. But it does not work for constant Q type of wavelets (JMLC, LeWalle). In my experiments with constant Q wavelet I need to upsample time axis to get meaningfull 3D plot. This is because at the top end of the freq scale time amplitude variations happen in a very fine time grid. Upsampling can be done by interpolation, but overall I would investigate more how to present constant Q types of plots in 3D, or not at all.


6) Suggestion: Better to close all figures in the start of a new run, otherwise they can be confusing if a different wavelet type is chosen. Also it seems to speed up the run a bit. Function close all;


7) Titles in the figures. If title of the figure has special characters it did not display properly. For example ir_file.wav displays letter f in lower case font. Use title('your title of the plot', 'interpreter', 'none'); to overcome this.


8) In LeWalle constant Q wavelet top octave above 10kHz seems to have some sort of artefacts. Antialiasing problems or something? Is there any solutions?



Other than that it works very well, and produces beautiful wavelet plots one can let his eyes to rest and dream about the marvels of the world :D


- Elias
 

Attachments

  • octave_font_warning.PNG
    octave_font_warning.PNG
    36.5 KB · Views: 140
Here is some observations I came across:
...

1.) fixed
2.) fixed
3.) graphic UI would be „nice to have“ - sure - but how to to ? Didn't have great luck with commands to bring up the file system GUI. (I checked it out some time back - maybe it improved meantime?)
and on the other hand QtOctave and Xoctave are „quasi-GUI“ for win / Linux users
4.) fixed
5.) I'm awaiting your suggestions :D
6.) fixed
7.) fixed
8.) have to have a closer look into that, eventually...

Maybe better to rename this type of plot to wavelet CSD or something.

9.) fixed

:umbrella:

WTF-Package ver. 18 :
http://www.kinotechnik.edis.at/pages/diyaudio/wavelet/mige0_start_wavelet_ver_1_8.zip


############

BTW
Found a new alternative to XOctave for win users - its called GUI Octave:

https://sites.google.com/site/guioctave/screenshots

Didn't want to dive into yet - so I don't know about price, faults or stability


:)

Michael
 
Last edited:
Unstoppable !!! :smash:

Ahem, always with wav from REW, the normalized plots are far too optimistic :

a 10" driver that makes 10000 Hz @ -30 dB reaches here 20000 Hz @ 0 dB either in spectro or CSD plots.

no problem with the non normalized plots :D

this issue must be related with REW wav files as it was here since the first releases
 
Unstoppable !!! :smash:

Ahem, always with wav from REW, the normalized plots are far too optimistic :

a 10" driver that makes 10000 Hz @ -30 dB reaches here 20000 Hz @ 0 dB either in spectro or CSD plots.

no problem with the non normalized plots :D

this issue must be related with REW wav files as it was here since the first releases

Well - the "normalized" plots are supposed to be - what you call "optimistic". ;)

As the naming "normalized" should indicate, the very purpose of that plots is to help in exterminating the temporal behaviour without being distracted by any kind of frequency response - hence - each frequency in the spectra once touches 0dB.

This is pretty useful with any tweeters / tweeter horns in particular, that fall off within the audio bandwidth.
look here for example:
http://www.diyaudio.com/forums/multi-way/161627-horn-honk-wanted-17.html

The Non-normalized plots would indicate that there are no problems with reflections at the top end as they got lost in the dB limiting - but - if this region is brought up to the same level as the rest - it immediately becomes obvious how their sonic pattern actually is in that region.
The beauty of wavelet analysis is that it still provides pretty good results at the the needed "dynamic range" of analysis.

So to compare apples by apples with respect to sonic patterns in the time domain you may want to look at the normalized plots first.

Michael
 
Last edited:
Hi!

Tested 1.8.

Issue 2) remains.

Correction: moved command set(0, 'defaulttextfontname', '*'); to the beginning of the start_wavelet.m file (after command clear; ). This command must be before any text/numbers are printed to a figure.


After that No Problem! Runs smooth :)


- Elias



1.) fixed
2.) fixed
3.) graphic UI would be „nice to have“ - sure - but how to to ? Didn't have great luck with commands to bring up the file system GUI. (I checked it out some time back - maybe it improved meantime?)
and on the other hand QtOctave and Xoctave are „quasi-GUI“ for win / Linux users
4.) fixed
5.) I'm awaiting your suggestions :D
6.) fixed
7.) fixed
8.) have to have a closer look into that, eventually...



9.) fixed

:umbrella:

WTF-Package ver. 18 :
http://www.kinotechnik.edis.at/pages/diyaudio/wavelet/mige0_start_wavelet_ver_1_8.zip


############

BTW
Found a new alternative to XOctave for win users - its called GUI Octave:

https://sites.google.com/site/guioctave/screenshots

Didn't want to dive into yet - so I don't know about price, faults or stability


:)

Michael
 
Hello,

Let's talk about the future, shall we :D

For the future purpose to ease the updates I propose an update to the structural organisation of the program. Now as I see it when a new feature is wanted most of the code must be rearranged. For example if we want new wavelet analysis implemented, first the wavelet script must be practically re written to match the current interface and the plotting must be transferred to the main level. This is troublesome because all the analysis require different settings for input and output. I think this is unneccessary complexity that can be avoided.

What I'm thinking is to ease things a bit. My proposal:

An externally hosted image should be here but it was not working when we last tested it.


Whereas:

MAIN is the upper level function to start the program run.

UI is a function that asks the user parameters. What we need is IR file and a certain amount of numerical parameters from the user. I have a file browser implemented in Octave which can browse the file structure and select the IR file (no need for typing any filenames, just press numbers).

WT 1.-WT N. are the different wavelet analysis functions. There can be as many as needed.
Note: plotting should be done inside WT, bacause first of all the WTs may require differently modified IR, secondly the normalisation may be different, and different plottings are needed. For example if a new feature is inplemented in WT (for example a new plot), only update WT function, no need to update MAIN nor UI.


In the ideal case UI asks the WT functions what input parameters are required and then they are asked from the user. They can be returned in a cell structure and UI can process them automatically in a for loop. This means if some input parameters (number of them, or meaning) is changed there is no need to update MAIN nor UI functions.


Doesn't this sound wonderfull lol :D


All this is because I got the feeling this plane is just taking off. One day we'll be flying high and fast! :)


- Elias
 
Hello,

Let's talk about the future, shall we :D

right now ???
:)

For the future purpose to ease the updates I propose an update to the structural organisation of the program.

agree to get WTF *even more* structured than with current *.mat files !
;)

Now as I see it when a new feature is wanted most of the code must be rearranged. For example if we want new wavelet analysis implemented, first the wavelet script must be practically re written to match the current interface and the plotting must be transferred to the main level. This is troublesome because all the analysis require different settings for input and output.

troublesome ?- well – I can tell you .. :)

I think this is unneccessary complexity that can be avoided.

Good news !
:D

What I'm thinking is to ease things a bit. My proposal:

An externally hosted image should be here but it was not working when we last tested it.


Whereas:

MAIN is the upper level function to start the program run.

UI is a function that asks the user parameters. What we need is IR file and a certain amount of numerical parameters from the user. I have a file browser implemented in Octave which can browse the file structure and select the IR file (no need for typing any filenames, just press numbers).

Great ! I didn't have much luck with starting a browser from Octave


WT 1.-WT N. are the different wavelet analysis functions. There can be as many as needed.
Note: plotting should be done inside WT, bacause first of all the WTs may require differently modified IR, secondly the normalisation may be different, and different plottings are needed. For example if a new feature is inplemented in WT (for example a new plot), only update WT function, no need to update MAIN nor UI.


In the ideal case UI asks the WT functions what input parameters are required and then they are asked from the user. They can be returned in a cell structure and UI can process them automatically in a for loop. This means if some input parameters (number of them, or meaning) is changed there is no need to update MAIN nor UI functions.


Doesn't this sound wonderfull lol :D

Yeah !!

All this is because I got the feeling this plane is just taking off. One day we'll be flying high and fast! :)


- Elias


Fasten your seat belts ladies and gentlemen – ready for take off !!!
:snail:

Michael
 
I did a quick survey into GUI programming last night.

Stumbling across JUICE :
Giving some Juce to cross-platform tools ? The Register

This is a library that was used to code a handy piece of audio software (Tracktion) and certainly should do the trick for what ever may be needed here.

In addition I downloaded "Visual C# Express 2005"

Visual C# 2005 Downloads and Code Samples

which is recommended as a work flow environment.

Being a total noob to GUI programming I didn't get much further than to make the it to "hello world" demo yesterday though ...
:D


The basic idea is to split further development of WTF Package into Octave coding that is structured as suggested :

Hello,

An externally hosted image should be here but it was not working when we last tested it.




- Elias



and into GUI coding that provides sort of "remote GUI" to set/ control parameters in Octave *.mat files and possibly will allow to fully remote-control Octave one day by just pressing some buttons.

Thsis way we possibly could ensure "fall-back compatibility" for a wide variety of OS and setups.
What you think ??

Michael
 
Last edited:
Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.