Skip to content

Commit

Permalink
Corrected some python wrapper tests.
Browse files Browse the repository at this point in the history
The deprecated rfft f32 has been removed from the wrapper
(rfft fast f32 is still included).
  • Loading branch information
christophe0606 committed Nov 4, 2022
1 parent 4d090be commit 989370f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 24 deletions.
21 changes: 0 additions & 21 deletions PythonWrapper/examples/testdsp.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,17 +266,6 @@ def realToIm1D(ar):
resultI = realToIm1D(resultR)*16
print(resultI)

nb = 128
signal = np.cos(2 * np.pi * np.arange(nb) / nb)

result=np.fft.fft(signal)
print(result)
cfftradix4f32=dsp.arm_cfft_radix4_instance_f32()
rfftf32=dsp.arm_rfft_instance_f32()
status=dsp.arm_rfft_init_f32(rfftf32,cfftradix4f32,nb,0,1)
print(status)
resultI = dsp.arm_rfft_f32(rfftf32,signal)
print(result)

nb = 128
signal = np.cos(2 * np.pi * np.arange(nb) / nb)
Expand Down Expand Up @@ -311,16 +300,6 @@ def realToIm1D(ar):
result=dct(signal,4,norm='ortho')
print(result)

cfftradix4f32=dsp.arm_cfft_radix4_instance_f32()
rfftf32=dsp.arm_rfft_instance_f32()
dct4f32=dsp.arm_dct4_instance_f32()
status=dsp.arm_dct4_init_f32(dct4f32,rfftf32,cfftradix4f32,nb,nb2,0.125)
print(status)
state=np.zeros(2*nb)
resultI = dsp.arm_dct4_f32(dct4f32,state,signal)
print(resultI)


signal = signal / 10.0
result=dct(signal,4,norm='ortho')
signalQ31=toQ31(signal)
Expand Down
7 changes: 4 additions & 3 deletions PythonWrapper/examples/testdsp5.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ def realToIm1D(ar):


scaled= np.dot(a.T , w)
ref=np.sum(scaled,axis=0)/np.sum(w)
print(scaled)
ref=scaled/np.sum(w)
#print(ref)

points = np.array(a).reshape(12*3)
Expand All @@ -100,9 +101,9 @@ def realToIm1D(ar):
#print(weights)

result=dsp.arm_barycenter_f32(points,weights,12,3)
#print(result)

assert_allclose(ref,result,1e-6)

assert_allclose(ref,result,rtol=1e-6,atol=1e-6)

print("Weighted sum")

Expand Down

0 comments on commit 989370f

Please sign in to comment.