Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Intel Community
- Software
- Software Development SDKs and Libraries
- Intel® Integrated Performance Primitives
- ippsTone_Direct_32f function to genrate sine phasor

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

rohitspandey

Beginner

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

01-05-2012
11:09 AM

99 Views

ippsTone_Direct_32f function to genrate sine phasor

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

Link Copied

6 Replies

rohitspandey

Beginner

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

01-05-2012
11:38 AM

99 Views

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

SergeyKostrov

Valued Contributor II

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

01-06-2012
06:28 AM

99 Views

Quoting rohitspandey

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

rohitspandey

Beginner

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

01-10-2012
02:16 AM

99 Views

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

igorastakhov

New Contributor II

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

01-10-2012
04:50 AM

99 Views

Regards,

Igor

rohitspandey

Beginner

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

01-20-2012
06:33 AM

99 Views

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

jeffc111

Beginner

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

02-07-2012
05:59 PM

99 Views

xl1 = single(cos(single(single(pi/2)*(0:100000))));

xl2 = single(cos(pi/2*(0:100000)));

plot(xl1-xl2)

The error will grow linearly with length (on average).

Now try this:

xl1a = single(cos(single(single(pi/2)*mod(0:100000,4))));

hold on;

plot(xl1a-xl2, 'g')

The error will be consistent and very small.

Cos and Sin are VERY sensitive to precision when their value is near zero, and since the cos(x) = cos(mod(x,2*pi)), the loss of significant digits to the right of the decimal has a huge impact on the output.

The main point is that your single precision matlab code is not a good reference.

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

For more complete information about compiler optimizations, see our Optimization Notice.