1# New functions for version 1.5 of the Python wrapper 2import cmsisdsp as dsp 3import cmsisdsp.fixedpoint as f 4import numpy as np 5import math 6import colorama 7from colorama import init,Fore, Back, Style 8from numpy.testing import assert_allclose 9 10 11NBSAMPLES=256 12 13data1=np.random.randn(NBSAMPLES) 14 15ref = np.sum(data1) 16#print(ref) 17t = dsp.arm_accumulate_f64(data1) 18#print(t) 19assert_allclose(ref,t) 20 21t = dsp.arm_accumulate_f32(data1) 22#print(t) 23assert_allclose(ref,t,rtol=2e-6)