|
This is a pre-processed version of the web page http://info-igor.org/IgorMessages/2019/06/Info-Igor_2019-06_0001.html. In this copy, the search terms dsites.com (0) have been highlighted to make them easier to find. If a search term was not found, then it may exist in the non-visible title, description, keywords or URL fields, or the contents of this document may have changed since it was indexed. Some web pages will not display properly in this pre-processor. Visit those pages directly by following this link. Visit the page itself before bookmarking it. The search engine that brought you here is not necessarily affiliated with, nor responsible for, the contents of this page. |
Subject: sound wave import
In-Reply-To: <221da5d3cd4f431287b296976e28bee2@rivm.nl>
References: <a3c0cf54-a750-784d-85ed-8e58e1d0243e@colostate.edu>
<69ab93601ae246ba9b5d1dd76623a14b@rivm.nl>
<d243d46a-51b9-a1f4-d41f-99e2a894d127@colostate.edu>
<221da5d3cd4f431287b296976e28bee2@rivm.nl>
Message-ID: <c4c8f60b-65a8-07ab-2834-5d0f7d075d9c@colostate.edu>
Stijn,
Oops, I intended to reply-to-list earlier; I'm going to send these last few messages there for the benefit of all viewers.
Thanks for your continued interest in this item. I can see no option besides writing a function which isn't such a bad thing after all.
Best regards,
Joseph
On Mon, 03 Jun 2019 2:57 AM, Stijn Berkhout wrote:
> It is a pity that the redimension operation has no provision for the conversion that you are after. I also looked into MatrixOp, which offers speed improvements and sometimes allows to do on a single line what requires many commands otherwise. Unfortunately I can't find anything there that will do the conversion in one go.
>
> Writing your own function seems to be the only way, then.
>
> Best regards,
> Stijn
>
>> -----Original Message-----
>> From: DiVerdi,Joseph [mailto:Joseph.DiVerdi at ColoState.EDU]
>> Sent: vrijdag 31 mei 2019 19:20
>> To: Stijn Berkhout
>> Subject: Re: sound wave import
>>
>> Thanks for your message Stijn. Apologies for going dark for a while.
>>
>> The method you mention below _is_ the long way because the destination wave must
>> be prepared, the data reformatted as you kindly note below then the original wave
>> needs killing. So the actual sequence is:
>>
>> "original information is in wdata"
>>
>> duplicate/o wdata wcmplx;
>> redimension/c/n=-1 wcmplx;
>> wcmplx = cmplx(wdata[p][0], wdata[p][1]);
>> duplicate/o wcmplx wdata;
>> killWaves wcmplx;
>>
>> "transformed information is in wdata"
>>
>> and consists of multiple commands
>>
>> I may be accused (and often am :) of being lazy yet I'd wondered if there isn't a single
>> command to reformat a two dimensional real wave immediately into a one dimensional
>> complex wave. I acknowledge that it's a pretty specific transformation yet having
>> worked with some "sound" data it seems (at least to me) like it might be a common
>> one.
>>
>> Continuing to muse upon the subject I might attempt writing a suitable function like the
>> following:
>>
>> function snd2cmplx(&my_wave) // pass wave by reference
>> duplicate/o/f my_wave temp_wave;// use a "free" wave that is
>> automagically destroyed upon completion
>> redimension/c/n=-1 temp_wave;
>> temp_wave = cmplx(my_wave[p][0], my_wave[p][1]);
>> duplicate/o temp_wave my_wave;
>> return 0;
>> end
>>
>> I haven't tested this at all, it has no error checking, it doubles the memory
>> requirements, etc. Just a thought...
>>
>> Best regards,
>> Joseph
>>
>> On Mon, 27 May 2019 2:57 AM, Stijn Berkhout wrote:
>>> Joseph,
>>>
>>> Assuming wcmplx is the complex wave the data should go to and wdata is your two-
>> dimensional real wave, this command will do the trick:
>>>
>>> wcmplx = cmplx(wdata[p][0], wdata[p][1])
>>>
>>> Best wishes,
>>> Stijn
>>>
>>>> -----Original Message-----
>>>> From: Info-igor [mailto:info-igor-bounces at lists.info-igor.org] On Behalf Of
>>>> DiVerdi,Joseph
>>>> Sent: zondag 26 mei 2019 19:41
>>>> To: Igor Discussion List
>>>> Subject: sound wave import
>>>>
>>>> Greetings,
>>>>
>>>> I'm working on a project where I import .wav files (into IP, of course). These wavs
>>>> represent complex (I & Q) data and that's the was I intend to use them. However,
>> the
>>>> default sound import dialog populates a two-dimensional real wave (with two
>> columns).
>>>>
>>>> I'd like to know if there is a "shortcut" method to convert such a two-dimensional
>> real
>>>> wave (with two columns) into a complex wave with the zeroth column populating
>> the
>>>> reals and first column similarly populating the imaginaries. I appreciate I can write it
>>>> out the long way - just hoping for a slicker one.
>>>>
>>>> Best regards,
>>>> Joseph
>>>> --
>>>> Joseph A. DiVerdi, PhD, MBA
>>>> Associate Professor of Chemistry
>>>> Colorado State University, Fort Collins, CO, USA
>>>> +1.970.980.5868 - http://sites.chem.colostate.edu/diverdi
>>>>
>>>> _______________________________________________
>>>> Info-igor mailing list
>>>> Info-igor at lists.info-igor.org
>>>> http://lists.info-igor.org/listinfo.cgi/info-igor-info-igor.org
>>>
>>> Dit bericht kan informatie bevatten die niet voor u is bestemd. Indien u niet de
>> geadresseerde bent of dit bericht abusievelijk aan u is verzonden, wordt u verzocht dat
>> aan de afzender te melden en het bericht te verwijderen. Het RIVM aanvaardt geen
>> aansprakelijkheid voor schade, van welke aard ook, die verband houdt met risico's
>> verbonden aan het elektronisch verzenden van berichten.
>>> www.rivm.nl<http://www.rivm.nl/> De zorg voor morgen begint vandaag
>>>
>>> This message may contain information that is not intended for you. If you are not
>> the addressee or if this message was sent to you by mistake, you are requested to
>> inform the sender and delete the message. RIVM accepts no liability for damage of any
>> kind resulting from the risks inherent in the electronic transmission of messages.
>>> www.rivm.nl/en<http://www.rivm.nl/en> Committed to health and sustainability
>>>
>>
>> --
>> Joseph A. DiVerdi, Ph.D., M.B.A.
>> Associate Professor of Chemistry
>> Colorado State University, Fort Collins, CO, USA
>> +1.970.980.5868 - http://sites.chem.colostate.edu/diverdi
>
>
> Dit bericht kan informatie bevatten die niet voor u is bestemd. Indien u niet de geadresseerde bent of dit bericht abusievelijk aan u is verzonden, wordt u verzocht dat aan de afzender te melden en het bericht te verwijderen. Het RIVM aanvaardt geen aansprakelijkheid voor schade, van welke aard ook, die verband houdt met risico's verbonden aan het elektronisch verzenden van berichten.
> www.rivm.nl<http://www.rivm.nl/> De zorg voor morgen begint vandaag
>
> This message may contain information that is not intended for you. If you are not the addressee or if this message was sent to you by mistake, you are requested to inform the sender and delete the message. RIVM accepts no liability for damage of any kind resulting from the risks inherent in the electronic transmission of messages.
> www.rivm.nl/en<http://www.rivm.nl/en> Committed to health and sustainability
>
--
Joseph A. DiVerdi, Ph.D., M.B.A.
Associate Professor of Chemistry
Colorado State University, Fort Collins, CO, USA
+1.970.980.5868 - http://sites.chem.colostate.edu/diverdi