Intel® Integrated Performance Primitives
Community support and discussions relating to developing high-performance vision, signal, security, and storage applications.
Announcements
This community is designed for sharing of public information. Please do not share Intel or third-party confidential information here.
6628 Discussions

ippsTone_Direct_32f function to genrate sine phasor

Beginner
209 Views
Hi,

I am try to genrate quadrature phasor vector using ippsTone_Direct_32f

foffsin = foffCos + pi/2;

.ippStatsSin = ippsTone_Direct_32f(&v2[0],Np,1.0,foffsin,&ZeroPh1,ippAlgHintAccurate);

but the genrated phasor is inverse i.e instead sin(x) its gnerating sin(-x); If i try foffsin = foffCos - pi/2 the phasor is all zero.
Kindly let me know what could be wrong.

Regards
Rohit
6 Replies
Beginner
209 Views
Hi,

The problem was due to freq range in case of real is 0-0.5 instead of 0-1. But t perfromace of IPP function is not comparable with matlab. Kindly share some light on this

Regards
Rohit
Valued Contributor II
209 Views
Quoting rohitspandey
...Butperfromace of IPP function is not comparable with matlab...

Could you provide more technical details? Was it faster or slower?
Beginner
209 Views

Hi,

The EVM i.e difference betweenthe matlab numerical value and IPP results increases as the number of sample points are big like 10^5 and high...

Regards
Rohit

New Contributor II
209 Views
Matlab uses 64f internaly (maybe 80f) - so you can try ippsTone_Direct_64f with conversion to 32f

Regards,
Igor
Beginner
209 Views
Hi,

Thats correct matlab uses double but if use the float variable in matlab the the results should be same.But you will see this is not the case. I tried comparing the tone generation with direct sin and cos function and compared the results are different.Tone generation function is not correctly working

Direct implementation

ippC = ippsVectorSlope_32f(&v1[0],Np,0,foff);

ippA = ippsCos_32f_A24(&v1[0], &v2[0], Np);

ippB = ippsSin_32f_A24(&v1[0], &v3[0], Np);

tone genrator

ippStatsSin = ippsTone_Direct_32fc(pbuf,Np,1.0,foff,&ZeroPh,ippAlgHintAccurate);

Used following matlab code

ang=2;%4,6,8,....

in=single([0:1:len-1]);

ph = single(pi/ang);

xI = single(cos(ph.*in));

xQ = single(sin(ph.*in));

And compared the result among them and with matlab. The direct implementation exactly matches matlab while tone genrator has rounding error and it grows as number of sample

Kindly verify the tone genrator implementation Function.

Regards
Rohit

Beginner
209 Views