[mirtoolbox] Re: question : get & set functions for mirspectrum objects

  • From: Olivier Lartillot <olartillot@xxxxxxxxx>
  • To: mirtoolbox@xxxxxxxxxxxxx
  • Date: Thu, 27 May 2010 16:49:51 +0300

Dear Marthe,

Thanks for your mail.

Marthe CURTIT kirjoitti 26.5.2010 kello 11.18:

> Dear Sir/Madam, 
> 
> I'm very pleased to use such a toolbox you developped.Actually, I'm using 
> Mirtoolbox functions to extract some pics. My question concern the set & get 
> functions for mirspectrum objects.
> 
> I did for example     s= mirspectrum ( miraudio ( 'myfile' ) )
> 
> I wanted then to replace phase and magnitude (from the spectrum I got) by 
> other values.
> 
> So, I did    g=mat2cell(' My Phase values' );
> and then    set (s,'Data',g);        But It didn't worked..

Actually, the transformation by users of internal data used in MIRtoolbox was 
not something planned so far. You might try to replace data, but I cannot 
guarantee the results..

Anyway, you need to keep the data structure used in the toolbox (as shown for 
instance with get(s, 'Data').

You can find an explanation of the data structure in this video (with link to 
the corresponding slides):
http://www.youtube.com/user/OlliLartillot#p/u/0/S_sB0yVoO88

> 
> Furthermore, I tried to use a get function like that: 
> 
> mirexport( 'Workspace', get (s,'Phase') )
> 
> the answer was :
> 
> ans = 
> 
>         types: {'11'}
>     filenames: {}
>          data: {[-0.0431]}
> 
> 
> ans.data =
> 
>     [-0.0431]
> 
> Would it means that the phase data contains only one point ?? As you can see, 
> I don't understand the structure of Data for a mirspectrum object. I would 
> greatly appreciate it if you could reply to my question, 

Just use p = get(s,'Phase')
Then you need to look inside the cell array returned by get. Your actual data 
should be something like p{1}{1}  (which means 1st song, 1st segment).
When you use mirexport, you don't obtain the rough data, but just its 
underlying statistics.

Regards,

Olivier

Other related posts: