Complex numbers input in neural networks

I need to extract features and train a neural network from frequency response data (magnitude and phase vs. frequency). The magnitude and phase is essentially form a complex number. I have 100 samples and each sample has 1000 magnitude and phase data points. The frequency range is the same for all data. What is the best way to feed this data to the “nntriantool. As far as I know this tool will not accept complex numbers. I cannot feed the magnitude and phase data separately, since it occurs as a pair. If the only way is to write my own neural network, how can I pass the input data as a pair OR will the neural network toolbox functions accept complex numbers as arguments Thanks in advance.

 採用された回答

Anton Semechko
Anton Semechko 2018 年 6 月 11 日

1 投票

You can represent a complex number, a+i*b, as a 2-vector [a b], so use that format instead. Suppose that F is an array of complex numbers, then to you can get real and imaginary components of F as follows: [real(F) imag(F)]

4 件のコメント

Saurabh Kulkarni
Saurabh Kulkarni 2018 年 6 月 11 日
Thanks! Basically, you are suggesting creating a cell array of 100 rows, 1000 columns with each element [real(F) imag(F)]?
Anton Semechko
Anton Semechko 2018 年 6 月 11 日
編集済み: Anton Semechko 2018 年 6 月 11 日
Lets say Y is a N-by-1 vector of outputs you want to use to train a NN and F is the corresponding N-by-d matrix of (complex) inputs that predict Y. Just break F into in a N-by-2*d array [real(F) imag(F)], and that should work.
Saurabh Kulkarni
Saurabh Kulkarni 2018 年 6 月 11 日
Thanks again Anton. I just created an array as you suggested. Looks like the nftool app will not accept this array as an input so I will go ahead and create my own Neural Network to process this array.
Priya Jose
Priya Jose 2019 年 11 月 27 日
Sir how dso you create your own neural network? i also want to add complex number target for training using nnstart.(fitting app)

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeDeep Learning Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by