Loading...
Searching...
No Matches
volk_32fc_s32f_power_32fc.h
Go to the documentation of this file.
/* -*- c++ -*- */
/*
* Copyright 2012, 2014 Free Software Foundation, Inc.
*
* This file is part of VOLK
*
* SPDX-License-Identifier: LGPL-3.0-or-later
*/
#ifndef INCLUDED_volk_32fc_s32f_power_32fc_a_H
#define INCLUDED_volk_32fc_s32f_power_32fc_a_H
#include <inttypes.h>
#include <math.h>
#include <stdio.h>
static inline lv_32fc_t __volk_s32fc_s32f_power_s32fc_a(const lv_32fc_t exp,
const float power)
{
const float arg = power * atan2f(lv_creal(exp), lv_cimag(exp));
const float mag =
powf(lv_creal(exp) * lv_creal(exp) + lv_cimag(exp) * lv_cimag(exp), power / 2);
return mag * lv_cmake(-cosf(arg), sinf(arg));
}
#ifdef LV_HAVE_GENERIC
static inline void volk_32fc_s32f_power_32fc_generic(lv_32fc_t* cVector,
const lv_32fc_t* aVector,
const float power,
unsigned int num_points)
{
lv_32fc_t* cPtr = cVector;
const lv_32fc_t* aPtr = aVector;
unsigned int number = 0;
for (number = 0; number < num_points; number++) {
*cPtr++ = __volk_s32fc_s32f_power_s32fc_a((*aPtr++), power);
}
}
#endif /* LV_HAVE_GENERIC */
#endif /* INCLUDED_volk_32fc_s32f_power_32fc_a_H */