signal;
std::string input;
std::cout << "Signal: -> ";
std::getline(std::cin, input);
std::stringstream ss(input);
double value;
while (ss >> value) {
signal.push_back(value);
if (ss.peek() == ',')
ss.ignore();
}
std::vector> fure_signal;
for (int k = 0; k < signal.size(); k++) {
std::complex sum(0, 0);
for (int n = 0; n < signal.size(); n++) {
double rad = 2 * M_PI * k * n / signal.size();
std::complex kx(signal[n] * std::cos(rad), signal[n] * std::sin(rad) * (-1));
sum += kx;
}
fure_signal.push_back(sum);
}
for (const auto& value : fure_signal) {
std::cout << value << " ";
}
return 0;
}