Decimated table exporting same size as original

6 ビュー (過去 30 日間)
Taylor Azizeh
Taylor Azizeh 2023 年 7 月 17 日
コメント済み: Taylor Azizeh 2023 年 8 月 21 日
I am trying to decimate a data file that was recorded at 100Hz and the original size of the file is ~6.16GB. I decimated the data by a factor of 2 (to reduce the sample rate to 50Hz), which seems successful:
However, when exported, the size isn't even 1GB less than the original file:
Is my decimation working correctly? Code below.
%%%% Loop to decimate 3 columns (out of 17 total columns)
s = size(data_XYZ);
r = 2;
n = ceil(s(1)/r);
data_XYZ_50 = zeros(n,s(2));
for k = 1:s(2)
data_XYZ_50(:,k) = decimate(data_XYZ(:,k),r);
end
%%%% Extracing every other line from the columns.
data_50 = data(1:2:end,:);
%%%% Replacing the 3 original columns with the decimated data
data_50{:,3} = data_XYZ_50(:,1);
data_50{:,4} = data_XYZ_50(:,2);
data_50{:,5} = data_XYZ_50(:,3);
save_directory = 'G:\path';
table_path = fullfile(save_directory, 'table.csv');
writetable(data_50,table_path)
  8 件のコメント
Stephen23
Stephen23 2023 年 8 月 21 日
"However, when I exported it as a CSV (this is the format I need), it is the same size."
A CSV file is just an uncompressed text file, why should it be any different?
"Are you saying that if my variable size in MATLAB looks decimated: 83745100/2 = 41872550, then it should be working?"
You could check it yourself: take the first few values, calculate by hand what you expect the "decimated" values to be.
Taylor Azizeh
Taylor Azizeh 2023 年 8 月 21 日
I would just assume that if you have half of the rows of data, logically, your file should be half the size.

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeMultirate Signal Processing についてさらに検索

製品


リリース

R2023a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by