VTK  9.4.20251007
vtkTableFFT.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-FileCopyrightText: Copyright 2009 Sandia Corporation
3// SPDX-License-Identifier: LicenseRef-BSD-3-Clause-Sandia-NVIDIA-USGov
4
31
32#ifndef vtkTableFFT_h
33#define vtkTableFFT_h
34
35#include "vtkFFT.h" // For vtkFFT::Scaling
36#include "vtkFiltersGeneralModule.h" // For export macro
37#include "vtkSmartPointer.h" // For internal method.
38#include "vtkTableAlgorithm.h"
39
40#include <memory> // For unique_ptr
41
42VTK_ABI_NAMESPACE_BEGIN
43
44class VTKFILTERSGENERAL_EXPORT vtkTableFFT : public vtkTableAlgorithm
45{
46public:
48 static vtkTableFFT* New();
49 void PrintSelf(ostream& os, vtkIndent indent) override;
50
52
60 vtkGetMacro(CreateFrequencyColumn, bool);
61 vtkSetMacro(CreateFrequencyColumn, bool);
62 vtkBooleanMacro(CreateFrequencyColumn, bool);
64
66
72 vtkGetMacro(DefaultSampleRate, double);
73 vtkSetMacro(DefaultSampleRate, double);
75
79 enum : int
80 {
86
88 };
89
91
98 vtkGetMacro(WindowingFunction, int);
99 virtual void SetWindowingFunction(int);
101
103
112 vtkGetMacro(ReturnOnesided, bool);
113 vtkSetMacro(ReturnOnesided, bool);
114 vtkBooleanMacro(ReturnOnesided, bool);
116
118
131 vtkGetMacro(AverageFft, bool);
132 virtual void SetAverageFft(bool);
133 vtkBooleanMacro(AverageFft, bool);
134
136
146 vtkGetMacro(Normalize, bool);
147 vtkSetMacro(Normalize, bool);
148 vtkBooleanMacro(Normalize, bool);
150
152
154
162 vtkGetMacro(BlockSize, int);
163 virtual void SetBlockSize(int);
165
167
177 vtkGetMacro(BlockOverlap, int);
178 vtkSetMacro(BlockOverlap, int);
180
182
190 vtkGetMacro(ScalingMethod, int);
191 vtkSetClampMacro(ScalingMethod, int, vtkFFT::Scaling::Density, vtkFFT::Scaling::Spectrum);
193
195
204 vtkGetMacro(Detrend, bool);
205 vtkSetMacro(Detrend, bool);
206 vtkBooleanMacro(Detrend, bool);
208
210
220 VTK_DEPRECATED_IN_9_3_0("Function has been renamed GetReturnOnesided")
221 virtual bool GetOptimizeForRealInput() { return this->GetReturnOnesided(); }
222 VTK_DEPRECATED_IN_9_3_0("Function has been renamed SetReturnOnesided")
223 virtual void SetOptimizeForRealInput(bool _arg) { this->SetReturnOnesided(_arg); }
224 VTK_DEPRECATED_IN_9_3_0("Function has been renamed ReturnOnesidedOn")
225 virtual void OptimizeForRealInputOn() { this->ReturnOnesidedOn(); }
226 VTK_DEPRECATED_IN_9_3_0("Function has been renamed ReturnOnesidedOff")
227 virtual void OptimizeForRealInputOff() { this->ReturnOnesidedOff(); }
229
231
239 "Block behavior is not controlled using BlockSize and BlockOverlap properties.")
240 virtual int GetNumberOfBlock() { return 0; }
242 "Block behavior is not controlled using BlockSize and BlockOverlap properties.")
243 virtual void SetNumberOfBlock(int) {}
245
246protected:
248 ~vtkTableFFT() override;
249
251 vtkInformationVector* outputVector) override;
252
258 void Initialize(vtkTable* input);
259
264
265private:
266 vtkTableFFT(const vtkTableFFT&) = delete;
267 void operator=(const vtkTableFFT&) = delete;
268
269 // Common
270 bool CreateFrequencyColumn = false;
271 double DefaultSampleRate = 1e4;
272 bool ReturnOnesided = false;
273 bool AverageFft = false;
274 int WindowingFunction = RECTANGULAR;
275 // Direct method
276 bool Normalize = false;
277 // Welch method
278 int BlockSize = 1024;
279 int BlockOverlap = -1;
280 bool Detrend = false;
281 int ScalingMethod = 0;
282
283 struct vtkInternal;
284 std::unique_ptr<vtkInternal> Internals;
285};
286
287VTK_ABI_NAMESPACE_END
288#endif // vtkTableFFT_h
@ Spectrum
Cross Spectrum scaling (V^2)
Definition vtkFFT.h:245
@ Density
Cross Spectral Density scaling (V^2/Hz)
Definition vtkFFT.h:244
a simple class to control print indentation
Definition vtkIndent.h:29
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
Hold a reference to a vtkObjectBase instance.
virtual void SetReturnOnesided(bool)
Specify if the filter should use the optimized discrete fourier transform for real values and return ...
virtual void SetOptimizeForRealInput(bool _arg)
virtual bool GetOptimizeForRealInput()
virtual void ReturnOnesidedOn()
Specify if the filter should use the optimized discrete fourier transform for real values and return ...
virtual void OptimizeForRealInputOff()
virtual void SetNumberOfBlock(int)
virtual void SetWindowingFunction(int)
Specify the windowing function to apply on the input.
virtual bool GetReturnOnesided()
Specify if the filter should use the optimized discrete fourier transform for real values and return ...
~vtkTableFFT() override
virtual void SetBlockSize(int)
Specify the number of samples to use for each block / segment in the Welch method.
virtual void OptimizeForRealInputOn()
virtual void ReturnOnesidedOff()
Specify if the filter should use the optimized discrete fourier transform for real values and return ...
static vtkTableFFT * New()
virtual void SetAverageFft(bool)
Specify if filter should use the Welch / periodogram method.
vtkSmartPointer< vtkDataArray > DoFFT(vtkDataArray *input)
Perform the FFT on the given data array.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void Initialize(vtkTable *input)
Initialize the internal state before performing the actual fft.
virtual int GetNumberOfBlock()
int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
This is called by the superclass.
@ MAX_WINDOWING_FUNCTION
Definition vtkTableFFT.h:87
A table, which contains similar-typed columns of data.
Definition vtkTable.h:60
#define vtkDataArray
#define VTK_DEPRECATED_IN_9_3_0(reason)