Azzera filtri
Azzera filtri

audioread() sampled data type conversion

5 visualizzazioni (ultimi 30 giorni)
nur dsc
nur dsc il 5 Dic 2021
Commentato: nur dsc il 6 Dic 2021
Hi,
I have double data returned from audio read file using audioread(). I need to get bit vector(numeric value includes 1s and 0s). Could you read an audio file using audioread() or audioread('native') ? How do you get bit array (1,0,1,0,0,0...) from sampled data you get from audioread() or audioread('native')? And then how do you get double data back from bit array ?
Thanks!

Risposte (1)

Walter Roberson
Walter Roberson il 5 Dic 2021
audioread() with 'native' will only return an integer data type if the data is stored as integer internally. That is not always the case.
typecast() the returned data to 'uint8' and then convert the uint8 to bit vectors.
Hint: non-zero uint8 can be used as indices into a list of bits for the byte...
  5 Commenti
Walter Roberson
Walter Roberson il 6 Dic 2021
You are back to asking about the fastest conversion method. That requires testing, not theory. And fastest is the topic of your other post and so should be discussed there. Really this present Question is a duplicate, since you asked the same thing as part of the other question, but since it was more narrowly focused on the question of datatype, I allowed it instead of closing it as Duplicate. The "fastest" part, however, is squarely the topic of the other question so I am not going to respond here. (Do not open multiple questions on the same topic in hopes that you might get a faster response.)
nur dsc
nur dsc il 6 Dic 2021
I think that this question is simpler than the other one.The other question was specific and got confused. It was not about getting a quick response. But thanks !

Accedi per commentare.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by