How to store complex double data to WAV?

조회 수: 25 (최근 30일)
Nik Rocky
Nik Rocky 2022년 9월 20일
댓글: James Muchechetere 2024년 3월 22일
Hello together,
I receive IQ data (real and imaginary values) from radio and save it to variable "IQ_data_before_write".
Then, I save it using (extended) audiowrite function to WAV file.
After using audioread, I get data in variable "IQ_data_after_read" back , but just real part of it.
Both data is atached.
If I visualize original and read data, I see a mirrored data at my center frequency after audiowrite + audioread.
1. how can I save whole data to WAV? (maybe split data before to real and imag, and after audioread join it again?)
2. Why is this "mirror effect" happens (see spectrum screenshot), of course of failed data? Maybe there are some another reasons (another dimensions)?
Thank you very much
Best regards
Nik
(Screenshots:
1: Original radio spectrum
2: Repeat of data spectrum stored data before writing into WAV file
3: Spectrum of reading IQ data after audiowrite and audioread)

답변 (1개)

Nik Rocky
Nik Rocky 2022년 9월 20일
I found a solution by spliting to real ang imag, save it in two different wav-files.
% split data to real and imag
data_I = real(IQ_data_before_write);
data_Q = imag(IQ_data_before_write);
% write wav files
audiowrite('data_I.wav',data_I,Fs);
audiowrite('data_Q.wav',data_Q,Fs);
% read wav files
[out_I,Fs] = audioread('data_I.wav');
[out_Q,Fs] = audioread('data_Q.wav');
% join I and Q
data_IQ = out_I + out_Q*1i;
Read-Output has the same structure and values now
  댓글 수: 1
James Muchechetere
James Muchechetere 2024년 3월 22일
Why did you multiply by 1i at the end? Thanks.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Audio and Video Data에 대해 자세히 알아보기

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by