Int n = signal size; const double pi = 14159265358979323846
Download 9.07 Kb.
|
4-variant
#include #include #include std::vector int N = signal.size(); const double PI = 3.14159265358979323846; std::vector for (int u = 0; u < N; u++) { double sum = 0; for (int x = 0; x < N; x++) { sum += signal[x] * cos(((2 * x + 1) * u * PI) / (2 * N)); } double Au = sum; if (u == 0) { Au /= sqrt(N); } else { Au *= sqrt(2 / static_cast } C.push_back(Au); } return C; } int main() { std::vector std::vector for (double value : Javob) { std::cout << value << " "; } std::cout << std::endl; return 0; } #include #include #include std::vector int a = matrix.size(); int b = matrix[0].size(); const double PI = 3.141592653589793; std::vector for (int u = 0; u < a; u++) {
int main() { std::vector {1, 2}, {3, 4} }; std::vector for (const auto &row : transformedSignal) {
return 0; } Download 9.07 Kb. Do'stlaringiz bilan baham: |
ma'muriyatiga murojaat qiling