There is a formula
The first is the Fourier transform itself, and the second lower is the formula for finding the spectral density (a formula based on the first), what I am trying to program and solve.
Separately added class of complex numbers in order not to clutter up the main form.
Such a question, which method can I solve the integral in the 2nd formula?
All searches were cited with references to alglib, but they are forbidden to use (anti-plagiarism and the department’s prohibition on the use of ready-made resources and libraries)
The code snippet written below is my attempt to recreate the solution of the problem step by step and formula. But there is one question, how to describe in its program the integral of the 2nd formula and then write it into its function.
public double calculate1(double u) { int nmax = 512; int k=0,t=1; double [] Rex=new double[nmax/2+1]; double [] Imx= new double[nmax/2+1]; double[] x = new double[nmax]; double f, w,ur=0,uit=0 ; Complex ct; int U = Convert.ToInt32(textBox1.Text); int T = Convert.ToInt32(textBox2.Text); Rex[k]=0; Imx[k]=0; for (double j = 0; j <= nmax / 2; j++) { f = 1 / T; w = 2 * Math.PI * f; u=U * Math.Exp( -j * w * t); } uit = U * T;//расчёт значения спектральной плотности амплитуд на нулевой частоте return u; } 