How to convert the complex number as a 2D vector to train a neural network
17 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Dear all,
I have a 4050 segment x 400 samples which are complex numbers. In order to train the neural network I need to split the data into a 2D real and imaginary and then create a 4D array that is accepted by the network to train. Any idea how to go about this?
Thanks a mil in advance.
Best,
Tyler
3 comentarios
Walter Roberson
el 26 de Nov. de 2021
You have a two dimensional array; call it Data for the moment. The rows correspond to different segments and the columns correspond to different samples, so Data(SegmentNumber, SampleNumber) is one piece of information. That information has a real and an imaginary part, so you have real(Data(SegmentNumber, SampleNumber)) and imag(Data(SegmentNumber, SampleNumber)) . So you have number of segments times number of samples times two (real + imaginary) pieces of information overall.
But to store number of segments by number of samples by two pieces of information, you can store that in an array that is (NumberOfSegments by NumberOfSamples by 2) large:
DataParts = zeros(size(Data,1), size(Data,2), 2);
DataParts(:,:,1) = real(Data);
DataParts(:,:,2) = imag(Data);
then DataParts(J,K,1) is real(Data(J,K)) and DataParts(J,K,2) is imag(Data(J,K)) . So you have managed to store all of the data into a three dimensional array.
Do you need 4 dimensions? You only need four dimensions if you have four independent variables: DataParts(SegmentNumber, SampleNumber, RealOrImaginaryPane, WHAT_IS_THIS_DIMENSION)
Sometimes though what you might need would be
DataParts = zeros(size(Data,1), size(Data,2), 1, 2);
DataParts(:,:,:, 1) = real(Data);
DataParts(:,:,:, 2) = imag(Data);
which would be NumberOfSegments by NumberOfSamples by 1 by 2. The 1 here would correspond to number of colour planes, but you only have one color plane.
Respuestas (1)
KSSV
el 26 de Nov. de 2021
To get real and imaginary part of the complex number, use real and imag. For other part use reshape.
0 comentarios
Ver también
Categorías
Más información sobre Build Deep Neural Networks en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!