- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear all
I need to get the quarter sine LUT in DDFS (Herewith the MATLAB code that I used) i=[0:i-1]; x= (i-1)*sin ((pi/2)*i/31));Link Copied
5 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
--- Quote Start --- I need to get the quarter sine LUT --- Quote End --- Hope you got it :) What exactly the question is?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
According to this equation :
i=[0:i-1]; x= (i-1)*sin ((pi/2)*i/i-1)+ 1/2*(i-1)); The result that I got is not the sine wave shape (the LUT values inverted in minus when it pass the half of (pi/2) range ). herewith the attached sine wave file- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
As far as i know MATLAB uses floating point representation, which is not implemented in HDL by default. Maybe if you give more information (LUT input,output width, precision, what language you use) I could help you out.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The Quarter sine wave LUT code for 8 bits:
i=[0:255]; x= 255*sin ((pi/2) *i /255); y=str(x,8) ; but when i used it in DDS simulation , I got no sine wave((note: i applied all the other requirment))- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
There is some error in your sine values but almost correct.
Try this: x = round(255*sin(2*pi*(0:1023)/1024)); x = x(1:256); You should get proper quarter sine from x otherwise tell us what you do with x. you can also just use: x = round(255*sin(2*pi*(0:255)/1024));
Reply
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