移动数据的下采样率(第一个点等于原始矩阵)

时间:2015-12-11 08:32:03

标签: matlab

我想知道尝试下载采样率的程序是否适合如下指令:y = downsample(x,n)

downsamp_rate = 40;
downsampled_data = downsample(X,downsamp_rate); 

..因为我怀疑为什么两个矩阵的第一列完全相同(原始矩阵和下载的样本)保持相同的数据....

然后其他数据已经转换为较低的采样率。

非常感谢你!

最佳!

编辑:示例数据。我粘贴了数据,但我可以上传de .mat文件。

原始数据。

  column 1             column 2          column 3
-0,593600000000000  -0,592699999999996  -0,591899999999995
2,42180000000000    2,41010000000000    2,40360000000000
1,78550000000000    1,79020000000000    1,79530000000000
-1,30590000000000   -1,31520000000000   -1,31530000000000
-0,707800000000003  -0,712699999999999  -0,727700000000003
-0,986500000000001  -0,996000000000002  -1,00460000000000
-0,989699999999999  -0,989699999999999  -0,989699999999999
1,23500000000000    1,22970000000000    1,21880000000000
0,122899999999998   0,127899999999997   0,128899999999998
0,938300000000003   0,937500000000002   0,936200000000004
0,248600000000004   0,248500000000002   0,248700000000002
-0,381499999999996  -0,393199999999999  -0,393699999999997
0,294099999999997   0,279299999999999   0,271299999999997
-0,223200000000001  -0,223699999999999  -0,227299999999997
0,0879999999999992  0,117300000000004   0,122500000000003
-0,167899999999999  -0,170999999999999  -0,174800000000003
-0,687499999999996  -0,697199999999998  -0,701600000000002
-0,681700000000002  -0,682200000000000  -0,683000000000000
1,19659999999999    1,19670000000000    1,19490000000000
-0,565500000000008  -0,565199999999999  -0,557400000000008

下采样数据

column 1               column 2            column 3
    -0,593600000000000  0,821900000000003   0,936300000000001
    2,42180000000000    1,14610000000000    -0,255400000000000
    1,78550000000000    2,86550000000000    3,66890000000000
    -1,30590000000000   7,01950000000000    12,9564000000000
    -0,707800000000003  3,05920000000000    0,852999999999998
    -0,986500000000001  -0,372200000000000  -0,951000000000002
    -0,989699999999999  -0,988000000000000  -1,21730000000000
    1,23500000000000    5,79700000000000    3,40880000000000
    0,122899999999998   5,32230000000000    5,19260000000000
    0,938300000000003   4,88130000000000    7,55900000000000
    0,248600000000004   4,79290000000000    2,96620000000000
    -0,381499999999996  -0,400000000000000  0,641500000000000
    0,294099999999997   -0,131400000000004  -1,20040000000000
    -0,223200000000001  1,49610000000000    1,59030000000000
    0,0879999999999992  0,418700000000000   -0,0114999999999976
    -0,167899999999999  0,0149999999999983  -0,857500000000000
    -0,687499999999996  -0,593100000000002  0,119700000000000
    -0,681700000000002  -0,170000000000003  0,126799999999999
    1,19659999999999    1,17670000000000    1,15780000000000
    -0,565500000000008  8,89019999999999    6,58569999999999

1 个答案:

答案 0 :(得分:0)

输出的可能性是周期长度为namespace panelApplication { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void copy_Click(object sender, EventArgs e) { // dataGridView2.Rows.Clear(); (code used if you want to delete previous selections) foreach (DataGridViewRow item in dataGridView1.Rows) { if (item.Selected == true) { int n = dataGridView2.Rows.Add(); dataGridView2.Rows[n].Cells[0].Value = item.Cells[0].Value.ToString(); dataGridView2.Rows[n].Cells[1].Value = item.Cells[1].Value.ToString(); dataGridView2.Rows[n].Cells[2].Value = item.Cells[2].Value.ToString(); } } } public void fetch_Click(object sender, EventArgs e) { this.productsTableAdapter.Fill(this.productsDataset.products); productsDataset dt = new productsDataset(); foreach (DataRow item in dt.products.Rows) { int n = dataGridView1.Rows.Add(); dataGridView1.Rows[n].Cells[1].Value = item["product_id"].ToString(); dataGridView1.Rows[n].Cells[2].Value = item["product_name"].ToString(); dataGridView1.Rows[n].Cells[3].Value = item["category_id"].ToString(); } } private void delete_btn_Click(object sender, EventArgs e) { try { if (dataGridView1.Rows.Cell[0].Text == TextBox1.tex) // error on this line. { } } catch (System.Exception) { MessageBox.Show("Not able to Delete"); } } private void dataGridView2_CellContentClick_1(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex >= 0) { DataGridViewRow row = this.dataGridView2.Rows[e.RowIndex]; product_idTxtbx.Text = row.Cells["product_id"].Value.ToString(); proName_txtbx.Text = row.Cells["product_name"].Value.ToString(); catID_txtbx.Text = row.Cells["category_id"].Value.ToString(); } } private void dataGridView2_CellClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex >= 0) { DataGridViewRow row = this.dataGridView2.Rows[e.RowIndex]; product_idTxtbx.Text = row.Cells["product_id"].Value.ToString(); proName_txtbx.Text = row.Cells["product_name"].Value.ToString(); catID_txtbx.Text = row.Cells["category_id"].Value.ToString(); } } private void delete2_Click(object sender, EventArgs e) { // if (dataGridView1.Rows["row.index"].Cells["productidDG"].Value.ToString() == product_idTxtbx.Text) { } } } 的周期性输入信号。举一个简短的演示:

downsamp_rate-1

因此,看看你的行40,41,42。我假设第一个值与你的行1,2,3

相同