276f8fc3fe9a7424bae6585ed4453190e2a70815,acoular/fbeamform.py,BeamformerFunctional,calc,#BeamformerFunctional#Any#Any#,438

Before Change


        -------
        This method only returns values through the *ac* and *fr* parameters
           
        kj = 2j*pi*self.freq_data.fftfreq()/self.c
        steerVecFormulation = steerVecTranslation(self.steer)
        normFactor = self.sig_loss_norm()
        for i in self.freq_data.indices:        
            if not fr[i]:
                kji = kj[i, newaxis]
                if self.r_diag:
                    // This case is not used at the moment (see Trait r_diag)
//==============================================================================
//                     One cannot use spectral decomposition when diagonal of csm is removed,
//                     as the resulting modified eigenvectors are not orthogonal to each other anymore.
//                     Therefor potentiating cannot be applied only to the eigenvalues.
//                     --> To avoid this the root of the csm (removed diag) is calculated directly.
//                     WATCH OUT: This doesn"t really produce good results.
//==============================================================================
                    csm = self.freq_data.csm[i]
                    fill_diagonal(csm, 0)
                    csmRoot = fractional_matrix_power(csm, 1.0 / self.gamma)
                    beamformerOutput, steerNorm = beamformerFreq(False, steerVecFormulation, False, 1.0, (self.r0, self.rm, kji, csmRoot[newaxis]))
                    beamformerOutput /= steerNorm  // take normalized steering vec
                    
                    // set (unphysical) negative output values to 0

After Change


    def _get_digest( self ):
        return digest( self )

    def calc(self, ac, fr):
        
        Calculates the Functional Beamformer result for the frequencies defined by :attr:`freq_data`
        
        This is an internal helper function that is automatically called when 
        accessing the beamformer"s :attr:`~BeamformerBase.result` or calling
        its :meth:`~BeamformerBase.synthetic` method.        
        
        Parameters
        ----------
        ac : array of floats
            This array of dimension ([number of frequencies]x[number of gridpoints])
            is used as call-by-reference parameter and contains the calculated
            value after calling this method. 
        fr : array of booleans
            The entries of this [number of frequencies]-sized array are either 
            "True" (if the result for this frequency has already been calculated)
            or "False" (for the frequencies where the result has yet to be calculated).
            After the calculation at a certain frequency the value will be set
            to "True"
        
        Returns
        -------
        This method only returns values through the *ac* and *fr* parameters
        
        i = self.freq_data.indices
        self.steer_obj.f = (self.freq_data.fftfreq()[i]).tolist()
        normFactor = self.sig_loss_norm()
        for cntFreq in range(len(i)):
            if not fr[i[cntFreq]]:
                if self.r_diag:
                    // This case is not used at the moment (see Trait r_diag)  
                    // It would need some testing as structural changes were not tested...
//==============================================================================
//                     One cannot use spectral decomposition when diagonal of csm is removed,
//                     as the resulting modified eigenvectors are not orthogonal to each other anymore.
//                     Therefor potentiating cannot be applied only to the eigenvalues.
//                     --> To avoid this the root of the csm (removed diag) is calculated directly.
//                     WATCH OUT: This doesn"t really produce good results.
//==============================================================================
                    csm = self.freq_data.csm[i[cntFreq]]
                    fill_diagonal(csm, 0)
                    csmRoot = fractional_matrix_power(csm, 1.0 / self.gamma)
                    beamformerOutput, steerNorm = self.steer_obj._beamformerCall(cntFreq, self.r_diag, 1.0, (csmRoot[newaxis],))
                    beamformerOutput /= steerNorm  // take normalized steering vec
                    
                    // set (unphysical) negative output values to 0
                    indNegSign = sign(beamformerOutput) < 0
                    beamformerOutput[indNegSign] = 0.0
                else:
                    eva = array(self.freq_data.eva[i[cntFreq]][newaxis], dtype="float64") ** (1.0 / self.gamma)
                    eve = array(self.freq_data.eve[i[cntFreq]][newaxis], dtype="complex128")
                    beamformerOutput, steerNorm = self.steer_obj._beamformerCall(cntFreq, self.r_diag, 1.0, (eva, eve))  // takes all EigVal into account
                    beamformerOutput /= steerNorm  // take normalized steering vec
                ac[i[cntFreq]] = (beamformerOutput ** self.gamma) * steerNorm * normFactor  // the normalization must be done outside the beamformer
                fr[i[cntFreq]] = True
            
class BeamformerCapon( BeamformerBase ):
    
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 34

Instances


Project Name: acoular/acoular
Commit Name: 276f8fc3fe9a7424bae6585ed4453190e2a70815
Time: 2018-05-02
Author: tom.j.gensch@campus.tu-berlin.de
File Name: acoular/fbeamform.py
Class Name: BeamformerFunctional
Method Name: calc


Project Name: acoular/acoular
Commit Name: 4b8dec5e7199ad302c52bf9eb6914a170491334c
Time: 2018-05-03
Author: tom.j.gensch@campus.tu-berlin.de
File Name: acoular/fbeamform.py
Class Name: BeamformerMusic
Method Name: calc


Project Name: acoular/acoular
Commit Name: 276f8fc3fe9a7424bae6585ed4453190e2a70815
Time: 2018-05-02
Author: tom.j.gensch@campus.tu-berlin.de
File Name: acoular/fbeamform.py
Class Name: BeamformerMusic
Method Name: calc


Project Name: acoular/acoular
Commit Name: 276f8fc3fe9a7424bae6585ed4453190e2a70815
Time: 2018-05-02
Author: tom.j.gensch@campus.tu-berlin.de
File Name: acoular/fbeamform.py
Class Name: BeamformerFunctional
Method Name: calc


Project Name: acoular/acoular
Commit Name: 4b8dec5e7199ad302c52bf9eb6914a170491334c
Time: 2018-05-03
Author: tom.j.gensch@campus.tu-berlin.de
File Name: acoular/fbeamform.py
Class Name: BeamformerFunctional
Method Name: calc