From e9be04eba6099887520b7f2d2d45d8479a13c3f9 Mon Sep 17 00:00:00 2001 From: SGudla Date: Mon, 20 Nov 2023 11:02:10 +0530 Subject: [PATCH] Tx: Update outputData type conversion from dataIn Update outputData conversion type from dataIn based on the dataType string to enable buffer transmission with different data types. Signed-off-by: SGudla --- Tx.m | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Tx.m b/Tx.m index 84b9b2c..01aef33 100644 --- a/Tx.m +++ b/Tx.m @@ -46,8 +46,8 @@ function setupImpl(obj,data) % outputData = complex(zeros(length(dataIn)*c,1)); for k = 1:2:c - outputData(k+0:c:end,1) = real(int16(dataIn(:,index).')); - outputData(k+1:c:end,1) = imag(int16(dataIn(:,index).')); + outputData(k+0:c:end,1) = real(cast(dataIn(:,index).', obj.dataTypeStr)); + outputData(k+1:c:end,1) = imag(cast(dataIn(:,index).', obj.dataTypeStr)); index = index + 1; end @@ -58,7 +58,7 @@ function setupImpl(obj,data) % outputData = zeros(length(dataIn)*c,1); for k = 1:c - outputData(k:c:end,1) = int16(dataIn(:,k).'); + outputData(k:c:end,1) = cast(dataIn(:,k).', obj.dataTypeStr); end end %%