()
| 6397 | } |
| 6398 | |
| 6399 | Variable[] fourierArray() { |
| 6400 | interp.getLeftParen(); |
| 6401 | Variable[] a = getArray(); |
| 6402 | int windowType = FHT.NO_WINDOW; |
| 6403 | if (interp.nextToken()==',') { |
| 6404 | interp.getComma(); |
| 6405 | String windowS = getString().toLowerCase(); |
| 6406 | if (windowS.equals("hamming")) |
| 6407 | windowType = FHT.HAMMING; |
| 6408 | else if (windowS.startsWith("hann")) //sometimes also called 'Hanning' |
| 6409 | windowType = FHT.HANN; |
| 6410 | else if (windowS.startsWith("flat")) |
| 6411 | windowType = FHT.FLATTOP; |
| 6412 | else if (!windowS.startsWith("no")) |
| 6413 | interp.error("Invalid Fourier window '"+windowType+"'"); |
| 6414 | } |
| 6415 | interp.getRightParen(); |
| 6416 | int n = a.length; |
| 6417 | float[] data = new float[n]; |
| 6418 | for (int i=0; i<n; i++) |
| 6419 | data[i] = (float)a[i].getValue(); |
| 6420 | float[] result = new FHT().fourier1D(data, windowType); |
| 6421 | int n2 = result.length; |
| 6422 | Variable[] a2 = new Variable[n2]; |
| 6423 | for (int i=0; i<n2; i++) |
| 6424 | a2[i] = new Variable(result[i]); |
| 6425 | return a2; |
| 6426 | } |
| 6427 | |
| 6428 | Variable[] printArray() { |
| 6429 | String prefix = null; |
no test coverage detected