Hanning Class Reference

Hanning window. More...

Inheritance diagram for Hanning:
[legend]
Collaboration diagram for Hanning:
[legend]

Public Member Functions

 TypeName ("Hanning")
 Runtime type information. More...
 
 Hanning (const dictionary &dict, const label nSamples)
 Construct from dictionary. More...
 
virtual ~Hanning ()=default
 Destructor. More...
 
bool symmetric () const
 Return the symmetric flag. More...
 
bool extended () const
 Return the extended flag. More...
 
scalar alpha () const
 Return the window coefficient. More...
 
- Public Member Functions inherited from windowModel
 TypeName ("windowModel")
 Runtime type information. More...
 
 declareRunTimeSelectionTable (autoPtr, windowModel, dictionary,(const dictionary &dict, const label nSamples),(dict, nSamples))
 
 windowModel (const dictionary &dict, const label nSamples)
 Construct from dictionary. More...
 
virtual ~windowModel ()=default
 Destructor. More...
 
label nSamples () const
 Return the number of samples in the window. More...
 
label nWindow () const
 Return the number of windows. More...
 
label nWindowsTotal (label nSamplesTotal) const
 Return the total number of windows for a given number of samples. More...
 
label validate (label n)
 Validate that the window is applicable to the data set size, and. More...
 
template<class Type >
tmp< Field< Type > > apply (const Field< Type > &fld, const label windowI) const
 Return the windowed data. More...
 
template<class Type >
Foam::tmp< Foam::Field< Type > > apply (const Field< Type > &fld, const label windowI) const
 
- Public Member Functions inherited from Field< scalar >
constexpr Field () noexcept
 Default construct. More...
 
 Field (const label len)
 Construct given size. More...
 
 Field (const label len, const scalar &val)
 Construct given size and initial value. More...
 
 Field (const label len, const Foam::zero)
 Construct given size and initial values of zero. More...
 
 Field (const Foam::one, const scalar &val)
 Construct with length=1, copying the value as the only content. More...
 
 Field (const Foam::one, scalar &&val)
 Construct with length=1, moving the value as the only content. More...
 
 Field (const Foam::one, const Foam::zero)
 Construct with length=1, initializing content to zero. More...
 
 Field (const Field< scalar > &fld)
 Copy construct. More...
 
 Field (const UList< scalar > &list)
 Copy construct from UList<Type> More...
 
 Field (const IndirectListBase< scalar, Addr > &list)
 Copy construct from IndirectList. More...
 
 Field (Field< scalar > &&fld)
 Move construct from Field. More...
 
 Field (List< scalar > &&list)
 Move construct from List. More...
 
 Field (DynamicList< scalar, SizeMin > &&list)
 Move construct from DynamicList. More...
 
 Field (const UList< scalar > &mapF, const labelUList &mapAddressing)
 Construct by 1 to 1 mapping from the given field. More...
 
 Field (const tmp< Field< scalar >> &tmapF, const labelUList &mapAddressing)
 Construct by 1 to 1 mapping from the given tmp field. More...
 
 Field (const UList< scalar > &mapF, const labelListList &mapAddressing, const scalarListList &weights)
 Construct by interpolative mapping from the given field. More...
 
 Field (const tmp< Field< scalar >> &tmapF, const labelListList &mapAddressing, const scalarListList &weights)
 Construct by interpolative mapping from the given tmp field. More...
 
 Field (const UList< scalar > &mapF, const FieldMapper &map, const bool applyFlip=true)
 Construct by mapping from the given field. More...
 
 Field (const UList< scalar > &mapF, const FieldMapper &map, const scalar &defaultValue, const bool applyFlip=true)
 Construct by mapping from the given field. More...
 
 Field (const UList< scalar > &mapF, const FieldMapper &map, const UList< scalar > &defaultValues, const bool applyFlip=true)
 Construct by mapping from the given field. More...
 
 Field (const tmp< Field< scalar >> &tmapF, const FieldMapper &map, const bool applyFlip=true)
 Construct by mapping from the given tmp field. More...
 
 Field (const tmp< Field< scalar >> &tmapF, const FieldMapper &map, const scalar &defaultValue, const bool applyFlip=true)
 
 Field (const tmp< Field< scalar >> &tmapF, const FieldMapper &map, const UList< scalar > &defaultValues, const bool applyFlip=true)
 
 Field (Field< scalar > &fld, bool reuse)
 Copy construct or re-use as specified. More...
 
 Field (const tmp< Field< scalar >> &tfld)
 Copy or move construct from tmp. More...
 
 Field (Istream &is)
 Construct from Istream. More...
 
 Field (const word &keyword, const dictionary &dict, const label len)
 Construct from a dictionary entry. More...
 
tmp< Field< scalar > > clone () const
 Clone. More...
 
void map (const UList< scalar > &mapF, const labelUList &mapAddressing)
 1 to 1 map from the given field More...
 
void map (const tmp< Field< scalar >> &tmapF, const labelUList &mapAddressing)
 1 to 1 map from the given tmp field More...
 
void map (const UList< scalar > &mapF, const labelListList &mapAddressing, const scalarListList &weights)
 Interpolative map from the given field. More...
 
void map (const tmp< Field< scalar >> &tmapF, const labelListList &mapAddressing, const scalarListList &weights)
 Interpolative map from the given tmp field. More...
 
void map (const UList< scalar > &mapF, const FieldMapper &map, const bool applyFlip=true)
 Map from the given field. More...
 
void map (const tmp< Field< scalar >> &tmapF, const FieldMapper &map, const bool applyFlip=true)
 Map from the given tmp field. More...
 
void autoMap (const FieldMapper &map, const bool applyFlip=true)
 Map from self. More...
 
void rmap (const UList< scalar > &mapF, const labelUList &mapAddressing)
 1 to 1 reverse-map from the given field More...
 
void rmap (const tmp< Field< scalar >> &tmapF, const labelUList &mapAddressing)
 1 to 1 reverse-map from the given tmp field More...
 
void rmap (const UList< scalar > &mapF, const labelUList &mapAddressing, const UList< scalar > &weights)
 Interpolative reverse map from the given field. More...
 
void rmap (const tmp< Field< scalar >> &tmapF, const labelUList &mapAddressing, const UList< scalar > &weights)
 Interpolative reverse map from the given tmp field. More...
 
void negate ()
 Negate this field (negative). More...
 
tmp< Field< cmptType > > component (const direction) const
 Return a component field of the field. More...
 
void replace (const direction, const UList< cmptType > &)
 Replace a component field of the field. More...
 
void replace (const direction, const tmp< Field< cmptType >> &)
 Replace a component field of the field. More...
 
void replace (const direction, const cmptType &)
 Replace a component field of the field. More...
 
VSForm block (const label start) const
 
tmp< Field< scalar > > T () const
 Return the field transpose (only defined for second rank tensors) More...
 
void writeEntry (const word &keyword, Ostream &os) const
 Write the field as a dictionary entry. More...
 
SubField< scalar > slice (const label pos, label len=-1)
 Return SubField slice (non-const access) - no range checking. More...
 
const SubField< scalar > slice (const label pos, label len=-1) const
 Return SubField slice (const access) - no range checking. More...
 
SubField< scalar > slice (const labelRange &range)
 Return SubField slice (non-const access) - with range checking. More...
 
const SubField< scalar > slice (const labelRange &range) const
 Return SubField slice (const access) - with range checking. More...
 
void operator= (const Field< scalar > &)
 Copy assignment. More...
 
void operator= (const tmp< Field< scalar >> &)
 
void operator= (const UList< scalar > &rhs)
 
void operator= (const SubField< scalar > &rhs)
 
void operator= (const IndirectListBase< scalar, Addr > &rhs)
 Copy assign from IndirectList. More...
 
void operator= (Field< scalar > &&rhs)
 Move assignment. More...
 
void operator= (List< scalar > &&rhs)
 
void operator= (DynamicList< scalar, SizeMin > &&rhs)
 
void operator= (const scalar &val)
 Value assignment. More...
 
void operator= (const Foam::zero)
 
void operator= (const VectorSpace< Form, Cmpt, nCmpt > &)
 
void operator= (const tmp< Field > &rhs)
 
void operator+= (const UList< scalar > &)
 
void operator+= (const tmp< Field< scalar >> &)
 
void operator+= (const scalar &)
 
void operator-= (const UList< scalar > &)
 
void operator-= (const tmp< Field< scalar >> &)
 
void operator-= (const scalar &)
 
void operator*= (const UList< scalar > &)
 
void operator*= (const tmp< Field< scalar >> &)
 
void operator*= (const scalar &)
 
void operator/= (const UList< scalar > &)
 
void operator/= (const tmp< Field< scalar >> &)
 
void operator/= (const scalar &)
 

Protected Attributes

bool symmetric_
 Symmetric switch. More...
 
bool extended_
 Extended switch. More...
 
scalar alpha_
 Window coefficient, default = 0.5. More...
 
- Protected Attributes inherited from windowModel
label nOverlapSamples_
 Number of overlap samples per window. More...
 
label nWindow_
 Number of windows. More...
 

Additional Inherited Members

- Public Types inherited from Field< scalar >
typedef pTraits< scalar >::cmptType cmptType
 Component type. More...
 
typedef SubField< scalar > subField
 Declare type of subField. More...
 
- Static Public Member Functions inherited from windowModel
static autoPtr< windowModelNew (const dictionary &dict, const label nSamples)
 Return a reference to the selected window model. More...
 
- Static Public Member Functions inherited from Field< scalar >
static const Field< scalar > & null ()
 Return nullObject reference Field. More...
 
static autoPtr< Field< scalar > > New (Istream &is)
 Return a pointer to a new Field created on freestore. More...
 
static tmp< Field< scalar > > NewCalculatedType (const Field< Type2 > &f)
 

Detailed Description

Hanning window.

The window is described by the function

\[ wf = (1 - \alpha) - \alpha cos(2 \pi t/m); \]

Where:

\( \alpha \) = Coefficient with a default value of 0.5
\( t \) = time
\( m \) = window width

The window can be further manipulated by the controls:

  • symmetric: force the window to be symmetric
  • extended: extend the window by 1 element at start and end to produce non-zero values at the start and end positions. Note: window is normalised to preserve energy content
Source files

Definition at line 84 of file Hanning.H.

Constructor & Destructor Documentation

◆ Hanning()

Hanning ( const dictionary dict,
const label  nSamples 
)

Construct from dictionary.

Definition at line 47 of file Hanning.C.

References Hanning::alpha_, Foam::cos(), Hanning::extended_, forAll, windowModel::nSamples(), Foam::sqr(), Foam::sqrt(), Foam::sum(), Foam::sumSqr(), Hanning::symmetric_, and Foam::constant::mathematical::twoPi().

Here is the call graph for this function:

◆ ~Hanning()

virtual ~Hanning ( )
virtualdefault

Destructor.

Member Function Documentation

◆ TypeName()

TypeName ( "Hanning"  )

Runtime type information.

◆ symmetric()

bool symmetric ( ) const

Return the symmetric flag.

Definition at line 95 of file Hanning.C.

References Hanning::symmetric_.

◆ extended()

bool extended ( ) const

Return the extended flag.

Definition at line 101 of file Hanning.C.

References Hanning::extended_.

◆ alpha()

Foam::scalar alpha ( ) const

Return the window coefficient.

Definition at line 107 of file Hanning.C.

References Hanning::alpha_.

Member Data Documentation

◆ symmetric_

bool symmetric_
protected

Symmetric switch.

Definition at line 94 of file Hanning.H.

Referenced by Hanning::Hanning(), and Hanning::symmetric().

◆ extended_

bool extended_
protected

Extended switch.

Definition at line 97 of file Hanning.H.

Referenced by Hanning::extended(), and Hanning::Hanning().

◆ alpha_

scalar alpha_
protected

Window coefficient, default = 0.5.

Definition at line 100 of file Hanning.H.

Referenced by Hanning::alpha(), and Hanning::Hanning().


The documentation for this class was generated from the following files: