MCPcopy Create free account
hub / github.com/LancePutnam/Gamma / zeroCrossFirst

Function zeroCrossFirst

src/arr.cpp:112–124  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

110}
111
112unsigned zeroCrossFirst(const float * src, unsigned len){
113 uint32_t * srcI = (uint32_t *)src;
114 uint32_t prev = *srcI++;
115
116 for(unsigned i=0; i<len-1; ++i){
117 uint32_t now = *srcI++;
118 if((now ^ prev)>>31){
119 return i-1;
120 }
121 prev = now;
122 }
123 return 0;
124}
125
126unsigned zeroCrossN(const float * src, unsigned len, float prevVal){
127

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected