[問題] 關於return的問題
程式碼如下
public float[] FFT_calculate(ArrayList fft)
{
float[] iobuffer = new float[1024];
PointF[] samples = new PointF[1024];
float[] x1 = new float[1024];
for (int k = 0; k < 1024; k++)
{
iobuffer[k] = (float)Convert.ToDouble(fft[k]);
samples[k].X = iobuffer[k];
iobuffer[k] = x1[k];
}
for (int i = 0; i < 1024; i++)
{
samples[i].Y = 0;
}
FFT_in(samples);
for (int n = 0; n < 1024; n++)
{
x1[n] = (float)(Math.Sqrt(samples[n].X * samples[n].X +
samples[n].Y * samples[n].Y));//fft頻譜的
}
return x1;
}
重點在最後幾行
我想要同時return x1跟samples兩個值 我該要怎麼做
補上主涵式
while (fft_ch1_1.Count == 1024 || fft_ch1_2.Count == 1024)
{
if (ch1_bool == true)
{
float[] fft_t_1 = calcu.FFT_calculate(fft_ch1_1);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
all_paint.ch1_fft(fft_t_1, ch1_fftbf, ch1_fft, fft_yscale);
float[] timef = calcu.timefreq(fft_t_1, label_time1);
all_paint.ch1_timefreq(timef, ch1_timef, brushpaint,ch1_timefcount);
ch1_timefcount++;
}
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 120.126.10.243
→
04/26 02:23, , 1F
04/26 02:23, 1F
→
04/26 02:23, , 2F
04/26 02:23, 2F
→
04/26 06:23, , 3F
04/26 06:23, 3F
推
04/26 08:09, , 4F
04/26 08:09, 4F