Bitstream into decimal values
Hi,
I have read a sound file and converted the mono 8-bit content (The data is an array of decimal values 125,126,124,126,129.........)
(in the sound file read.vi) into binary stream and used the data for modulation(PSK). Now after demodulation I've to convert the bit stream back into original decimal values to compare the original (baseband) power spectrum.
How to convert the output bitstream into decimal values(like 125,126,124........).
How to do this?
Scan/Format string will not work here.
I've done the decimal to binary conversion like this
Thanks
Celia
Attachments:
decimal to bitstream conversion.vi 36 KB
Hello celia,
maybe this could help you...
Btw. I would not call it a binary stream. It's a stream of I16 values in your case!
Best regards,
GerdW
CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
Kudos are welcome
Attachments:
decimal to bitstream conversion_and_back.vi 40 KB
Similar Messages
-
How to load decimal values into a file using bcp in SQL Server 2000?
Hi everyone,
I'm trying to load data from a database table to a text file using bcp on SQL Server 2000. When I'm loading the decimal values, the values before the decimal are not being loaded into the file. How could I load the values before decimals?
Here are the DDLs and DMLs of what I'm trying to run:
CREATE TABLE [dbo].[Product_Sales](
[Year_of_Sale] [smallint] NOT NULL,
[Product_Type] [varchar](25) NOT NULL,
[Product_Group] [varchar](25) NOT NULL,
[Category_Type] [varchar](25) NOT NULL,
[Category_Group] [varchar](10) NOT NULL,
[Product_Count] [bigint] NOT NULL,
[Product_Amount] [decimal](19, 2) NOT NULL,
[Category_Count] [bigint] NOT NULL,
[Category_Amount] [decimal](19, 2) NOT NULL,
CONSTRAINT [PK_Product_Sales] PRIMARY KEY CLUSTERED
[Year_of_Sale] ASC,
[Product_Type] ASC,
[Product_Group] ASC,
[Category_Type] ASC,
[Category_Group] ASC
) ON [PRIMARY]
) ON [PRIMARY]
INSERT INTO [Yearly_Sales].[dbo].[Product_Sales]
VALUES(2010, 'Online', 'Web', 'Cameras', 'Electronics', 547, 0.00, 0, 0.00)
EXEC [master].[dbo].[xp_cmdshell] 'bcp "SELECT * FROM [Yearly_Sales].[dbo].[Product_Sales]" queryout D:\Yearly_Sales\Product_Sales.dat -c -T -S'
And the output I see in the file is:
2010 Online Web Cameras Electronics 547 .00 0 .00
The values before decimals are being truncated.
Thanks,
Bangaaram
Known is a DROP, Unknown is an OCEAN.You can modify the decimal column(s) in the table to varchar type before export. But it does not look good.
alter table [dbo].[Product_Sales]
Alter column [Product_Amount] varchar(20)
alter table [dbo].[Product_Sales]
Alter column [Category_Amount] varchar(20)
Does that make any sense?
Known is a DROP, Unknown is an OCEAN.
Basically you modify the decimal column to a varchar type before you run the bcp command for export. You can modify your source table or you can modify them on the fly. It is just a workaround.
Modifying the source wouldn't be a good idea. Never do that if you can't get your desired output.
Known is a DROP, Unknown is an OCEAN. -
Need to convert a binary value into decimal
Hi i need to convert a binary value which i would be getting as a string object to a decimal value......need code for the same
Check Integer.parseInt
http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Integer.html#parseInt(java.lang.String,%20int) -
How to display BAPI decimal values into webdynpro!
Hi All,
I have a problem to display decimal values from R/3 system to webdynpro table.
Iam using structure there declared all the varaibles as decimal 15,2 .
But I am not able to disply the decimal values intable of webDynpro.
Please help me for this.
Thanks in advance.
BHIHi,
as u r importing RFC model all the datatypes in java side corresponding to r/3 are also created .
see in the dictonary of ur project .simple and structure type are created and u can use it.
and u r storing the data in some model node so when u r using table control rightclick on table and select structure binding it will display the context in ur view and from there u can select the attributes u want to display.
if u r copying data of modelnode to value node u can also select structure binding option in wizard which set the datatype for the attributes .
thanks,
yashpal -
Decimal value automatically converting into int
Hi,
I have a SQL column which is a string and its value is casted to have decimal value. For example 92.57
In C#, below is the code I have written to retreive the value.
command.Parameters.Add("@ProcessCompliance", SqlDbType.Decimal).Direction = ParameterDirection.Output;
ProcessComplaincecount = command.Parameters["@ProcessCompliance"].Value.ToString());
But value is getting converted as 93 as a int. I want it as 92.57
Regards, Shreyas R SFor best results, you should post this question in the SQL development or C# forums. (This is a SharePoint forum.)
Mike Smith TechTrainingNotes.blogspot.com
Books:
SharePoint 2007 2010 Customization for the Site Owner,
SharePoint 2010 Security for the Site Owner -
How to make the Decimal values into Round off value
Hi Experts,
I have an internal table with 3 columns, the 3rd column having decimal values, Now i want to convert the values in to whole number, Ex: 15.67 will be 15.7
Anyone plz help this.
Mohanahii
use following code
DATA:
wa_val type p decimals 2,
L_ANDEC like T006-ANDEC value 1,
wa_val2 type p decimals 1.
wa_val = '15.67' .
CALL FUNCTION 'ROUND'
EXPORTING
DECIMALS = L_ANDEC
input = wa_val
SIGN = '+'
IMPORTING
OUTPUT = wa_val2
EXCEPTIONS
INPUT_INVALID = 1
OVERFLOW = 2
TYPE_INVALID = 3
OTHERS = 4
WRITE:/ wa_val2.
regards
twinkal -
How do I convert an alpha character from a text string to its decimal value
I am trying to find out the actual decimal value of a character in a string. So far the code below is as far as I got. I am able to get what I guess is a byte value.
This is for a school assignment:
The idea behind what I am trying to do is to design a hash function to store dictionary words into a bucket array hash table, without using the existing Hashtable.class
so far this is what I can come up with to get some kind of value for each character in the string, however, what I am trying to get is the decimal value for each character.
public static void main(String args[]){
String word = "abcdefghijklmnopqrstuvwxyz";
for (int i=0 ; i < word.length(); i++){
System.out.print((word.substring(i,i+1)));
System.out.print("\t : "+((word.substring(i,i+1))).getBytes());
Thankyou for any replies.I'm not sure I completly understand your goal- what you mean by "decimal value", but, if you simply want to find the byte value of each character in a String, you would probably be better off using getBytes() in a way like this,
byte [] bytes = string.getBytes();
Then, if you need to map that to a charcter, you could use a for loop like
for (int x = 0; x < bytes.length; x++) {
table.put((char)bytes[x], bytes[x]);
which assummes this bucket class of yours allows primitive data types like so (in Hashtable or HashMap, you would have to use a wrapper Object). I guess, my point reduces to, don't use substring and string search methods (like indexOf()), unless you have to because they are more expensive then just maping the array of bytes and chars, which seems to be what you are interested in doing. -
Loading decimal value to an infoobject of type char
I have an extract structure with field timestamp, which is of type dec and length 15. Now i want to load this value to an infoobject in ODS. But this infoobject is of type char and length 18. when infopackage loading is scheduled it is giving the following error. Record 1 :InfoObject /BIC/IFITMSTMP does not contain alpa-conforming value 20061206084944.
Is it because i tried to move a dec valu into a char field with a different length? If so how will i load a decimal value of length 15 to a char of length 18. Can anyone please help me with this?
Thanks in advance.if u r using BI7.0
go to the datasource of the cube
in the general info tab of the datasource
there is a check box with PSA not typed
check it
if u check it all the values from the external source will be converted into character format irrespective of their data type -
Loading a decimal value to an infoobject of type char
I have an extract structure with field timestamp, which is of type dec and length 15. Now i want to load this value to an infoobject in ODS. But this infoobject is of type char and length 18. when infopackage loading is scheduled it is giving the following error. Record 1 :InfoObject /BIC/IFITMSTMP does not contain alpa-conforming value 20061206084944.
Is it because i tried to move a dec valu into a char field with a different length? If so how will i load a decimal value of length 15 to a char of length 18. Can anyone please help me with this?
Thanks in advance.if u r using BI7.0
go to the datasource of the cube
in the general info tab of the datasource
there is a check box with PSA not typed
check it
if u check it all the values from the external source will be converted into character format irrespective of their data type -
Static Decimal value in insert query
HI am going to insert decimal value in table but i got this error" Arithmetic overflow error converting numeric to data type numeric."
HERE val one is a decimal value how can do this?
INSERT INTO TBL(CON,VAL)
SELECT ID,'2.0' FROM TBL1Chino,
SHud eb a problem with the precision value of your column. Try increasing the same. The following example shud help:
--case 1
declare @tab table (id decimal(3,2),name varchar(100))
--precision=1 scale=2
insert @tab select 51.987 , 'jk'
select * from @tab
Msg 8115, Level 16, State 8, Line 2
Arithmetic overflow error converting numeric to data type numeric.
--case 2
declare @tab table (id decimal(4,2),name varchar(100))
--precision=2 scale=2
insert @tab select 51.987 , 'jk'
select * from @tab
Works Fine
Thanks,
Jay
<If the post was helpful mark as 'Helpful' and if the post answered your query, mark as 'Answered'> -
Writing decimal value to application file
hi All,
I am having an internal table with fields itab-A, itab-b and itab-C.
i want to write the record to itab in such a way that
itab-ASPACEitab-bitab-c.
Now i tried to concatenate the record in one string and write it out but the problem is itab-b is decimal value so it cant be concatenated. and also i m not getting value if i write
concatenate itab-A SPACE into val.
Can you suggest me something?
thanks and regards,
ReenaHi Reena,
Convert decimal value to character and write to application server.
The sample code here.
data:
lv_ format TYPE hslxx9,
lv_char_hsl TYPE char23,
CALL FUNCTION 'CEVA_CONVERT_FLOAT_TO_CHAR'
EXPORTING
float_imp = wa_finbal-hsl
format_imp = lv_format
IMPORTING
char_exp = lv_char_hsl.
Regards
Bhupal reddy -
Decimal Value for Percentage distribution on Account Assignement in SES
Dear Experts,
While creating service entry, the qty should be distributed on percentage basis for Account assignment with decimal value.
For Example
Say Service 100% done but value is 10,000..but there is distribution to different cost center say K, L , M, N
K - 21.25% - value 2125
L - 32.70% - value 3270
M - 28.93% - value 2893
N - 17.22% - value 1722
So i need to customize decimal values for Percentage distribution for Service entry sheet creation. Please advice me, if you know the solution for this
Regards
SaravananHi
In Transaction CUNI, as lot is a created Unit of measure wuth no dimensions select No Dimensions & continue
Now change the decimal places for the Unit from3 to 5.
In the service entry sheet you will be able to maintain the lot upto 5 decimals....
But there is again aproblem in that as the standard field Quantity MENGE has only 3 decimal places allowed, so agian you will encounter a problem.
So the best method to follow is advise the user to go for a 3 decimal reounding off the work.
Hope you understand the Problems that arise when decimal places are changed we need to take a lot of things into considertaion before going forward
Thanks & Regards
Kishore -
Zero Decimal values in AL11 file download
Hi Experts,
We have a program to download data into XLS file in AL11 application server. We have a currency column to be passed on to the file. The issue here is I have a decimal value like 201.30 and 200.00 but these values are downloading in AL11 as 201.3 and 200, But I want the values as how it is passing in the string. I am using Open data set statement and inside that concatenating all fields and transferring it into file. I tried searching in the forum and find couple of links none of them helped. Could anyone advice how to overcome this?
Thanks
SivaWe have a program to download data into XLS file in AL11 application server.
You are having problem when you are trying to upload the quantity from excel ( presentation server ) to AL11 ( application server ) or vice versa ? -
Converting char to decimal value format as defined in SU3(User profile)
Hi Techies,
Is there any FM to convert CHAR value into Decimal fomat as defined in SU3.
If we use, WRITE statement for printing the value in decimal format , it shows the value in decimal format correctly
in SU3 transaction , there are three different decimal format notations which can be user specific
I would appreciate your valuable inputs ....
Thanks
SanthoshThis is my code in a generic method to transform a table into a csvrow
when 'P'.
tmpstr = <p_field>.
len = strlen( tmpstr ) - 1.
tmpstr = tmpstr+0(len).
if <p_field> < 0.
sign = '-'.
else.
sign = ' '.
endif.
case decimalformat.
when 'X' or 'E'.
split tmpstr at '.' into int frac.
ptmp = int.
write ptmp to cp.
shift cp left deleting leading space.
replace all occurrences of '.' in cp with ','.
concatenate
s
sign
cp
frac
delimiter
into s in character mode.
when 'Y' or 'D'.
split tmpstr at '.' into int frac.
ptmp = int.
write ptmp to cp.
shift cp left deleting leading space.
replace all occurrences of ',' in cp with '.'.
concatenate
s
sign
cp
frac
delimiter
into s in character mode.
when ' '.
concatenate s sign tmpstr delimiter into s in character mode.
when others.
concatenate s '????????' delimiter into s in character mode.
endcase.
where pfield is a fieldsymbol type P. (honestly ist from type any, but determined by RTTI). I needed this cause i want to format the value from "outside" without taking the user settings in consideration as write...to.. is doing.
What i'm doing is to use the write... to... clause modifying the result (change decimal point, thousand separator and sign) according to the demanded decimal notation.
Edited by: Rainer Hübenthal on Oct 7, 2009 4:47 PM -
Integer values and decimal values in weblient UI - Display mode
Hello,
i have developed an custom assignmentblock with some custom fields.
Some of this fields are integer values and text values.
Some other fields are decimal values.
I face the issue that this decimal values are in display mode right-aligned all other fields are left-aligned.
In edit mode all values are right-alligned.
How can i change this behaviour? All values left-alligned in display mode!
Otherwise this looks strange.
Thank you
Kind regards
ManfredHi,
Decimal values will be displayed right-aligned. To change that you need to modify the GET_M method.
In get_m method, you have to change the attr datatype to string.
Data: attr type string.
Data: dref type ref to data.
Get reference of attr into dref.
Regards,
Arun
Edited by: Arun Kumar on May 14, 2010 3:03 PM
Maybe you are looking for
-
Hi Gurus Please any one can suggest a report that can handle the following scenario: We are in need of a report that will show us the velocity or how quickly or slowly an item is moving in our inventory by bin location(s). If there is a lot of invent
-
Can Folder View be Set to Show Hierarchy by Default?
I am working in PSE8 Organizer. When I open the Folder Location view I always have to "drill down" from the C drive in the hierarchy to the folder I want to see. Is there a way to set the Folder Location view to open and show by default the hierarch
-
1x1 GIF Image presented instad of requested page
For the past few months, I'm regularly unable to get to some web pages and instead get a 1x1 GIF image. I'm running Norton Internet Security (21.6.0.32). I regularly apply all the updates for Win 7, Firefox, Java, Flash, etc. Sometimes when launched
-
Itune application crashes when launched
After clicking the itunes icon, I get iTunes has encountered a problem and needs to close. We are sorry for the inconvenience.
-
Partial grouping of ALV grid lines
Hello. I have the following table and I want to do a partial grouping of the lines: Order number | Vendor | Oder line | Order quantity | Total quatity shipped | Track ID | Shipped | 418 | ABC | 01 | 08 | 00