520 666 信号抽取

Posted yegwy88

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了520 666 信号抽取相关的知识,希望对你有一定的参考价值。


(520|600).666 Information Extraction Homework # 6

Due Thursday, April 27, 2023.

Connectionist Temporal Classification

Consider the task of recognizing an M length sequence of tokens, y1M , from a T length input xT1 . The CTC objective function is one objective for such sequence transduction tasks which works by converting y1M into an alignment sequence sT1 of the same length as xT1 by using an additional symbol ? to fill the extra space. Note that it assumes T ≥ M. β?1?y1M? represents the set of all possible T -length alignments, sT1 , for the sequence y1M .

T

logp?y1M|xT1 ? = log X Yp?st|xT1 ? (1)

sT1 ∈β?1(y1M)t=1

We will consider that p ?st|xT1 ? is obtained by normalizing the outputs of a neural network, φ. Element, φtst ∝ p ?st|xT1 ?, of the matrix, φ, can be used to compute the CTC objective

where

and |S| is the number of output units in the neural network. 1. WFST Representation of the CTC Objective

Consider the task of modeling the word “all” using characters as the tokens. In this case M = 3. For this question, we will model words using both the HMM, and CTC objective functions and examine the different unweighted (i.e., the weights on each arc are 1.0) WFST topologies used for each. Remember that final states are indicated by using a double circle instead of a single circle around the state label. Mark all the input and output labels.

(a) Draw the WFST corresponding using a 1-state HMM for each letter and uniform state transitions. Assume the output labels could be fed into a pronunciation lexicon to recover the word, i.e., a - l - l → all

(b) Draw the WFST corresponding to the CTC topology. Recall that it should be able to accept strings starting or ending with ?.

(c) Enumerate all possible length 5 alignments of the word “all” accepted by the HMM topology where the HMMs for each letter are strung together with null arcs.

(d) Enumerate all possible length 5 alignments of the word “all” accepted by the CTC topology

(e) Draw the HMM trellis, often called a lattice, corresponding to all possible length 5 sequences as a WFST. (It should still look very similar to a normal trellis). Ignore the weights on the arcs. Do not draw any unnecessary (unused) nodes. Please include input and output labels.

(f) Repeat (e) but for the CTC trellis, corresponding to all possible length 5 se- quences as a WFST.

2. WFST Composition

The outputs of a neural network, φ, can themselves be represented as a WFST. Imagine the neural network has 4 outputs. In other words, it outputs vectors φt ∈ R1 x 4. The first output corresponds to the ? symbol, the second symbol corresponds to a, the third symbol to b and the fourth to l.

For this problem consider the matrix of scores, φ, where each column corresponds to a time index, and each row corresponds to one of the network outputs. These are like to observation probabilities in HMMs. We can draw this matrix as a WFST with 6 states corresponding to the length of the neural network output (5+1, where +1 is for a start state). Between each node there are as many arcs as there are output symbols (i.e., rows in the matrix). The input and output labels for this WFST will be the same (i.e., it is a WFSA), and the weights on the arcs correspond to the scores of those symbols at that position in time. Use the following matrix.

(3)

(a) Draw this WFST. Feel free to use some shorthand notation provided it is logical if this process seems tedious. We will call it Φ.

(b) Use the WFST, Φ, from part (a) and compose it, with the CTC WFST, which we will call T , from problem (1.) using the log-semiring, i.e., Φ ? T . Assume unweighted arcs all had a weight of 1. Recall that in the log-semiring, a L b = logea +eb,aNb=a+b,1=0,and0=∞. Showeachstepofthecomposition by denoting states with the pairs of labels on states used in Φ and T, like (Φi,Tj). Feel free to use any computational aid, i.e. a program or calculator, to help. Remember to remove any branches that don’t end in final states. A final state occurs when the both states in the pair of WFSTs are final.

(c) Compare the resulting WFST with the CTC trellis computed in problem (1.f) and comment.

(d) Use the forward algorithm on the result of part (b) to compute the CTC objective for this utterance. Again feel free to use any computational aid.

3. Prove that the posterior distribution modeled by CTC is globally normalized, i.e., the probability of a sequence is computed as the score of the sequence normalized by the sum of scores over all possible sequences and can be expressed as

Ep(y′) e 1 Make sure to state any assumptions used.

4. Using the result of problem (3.), show that maximizing the CTC objective maximizes a lower bound on the mutual information, I (X; Y ), between input and output sequences.

 WX:codehelp

CIC滤波器基于MATLAB/FPGA的数字CIC滤波器的设计

FPGA代码:

module down(
           i_clk,//输入时钟
           i_rst,//输入复位信号
           i_M,  //抽取值
           i_data,//输入信号
           o_data,//输出信号
           r_clk
           );
           
input              i_clk;//输入时钟
input              i_rst;//输入复位信号
input       [7:0]  i_M;  //抽取值          
input signed[31:0] i_data;//输入信号
output signed[31:0]o_data;//输出信号
output             r_clk;//输出信号
reg       [7:0] r_cnt =8'd0;
reg signed[31:0]o_data=32'd0;
reg             r_clk =1'b0;

always @(posedge i_clk)
begin
     if(!i_rst)//系统复位
     begin
     r_cnt<=8'd0;
     r_clk<=1'b0;
     end
else begin
          if(r_cnt==i_M/2-1)//分频
          begin
          r_clk<=~r_clk;
          r_cnt<=8'd0;
          end
     else begin
          r_cnt<=r_cnt+1'b1;
          r_clk<=r_clk; 
          end 
     end
end 

always @(posedge r_clk)
begin
     if(!i_rst)//系统复位
     begin
     o_data<=32'd0;
     end
else begin
     o_data<=i_data;//抽取
     end
end 


endmodule           

MATLAB代码:

clc;
clear;
close all;

%CIC又称为梳状滤波器,所以这里首先给出其梳状波形。。。。
%积分滤波器的响应
b1=1;
a1=[1 -1];
D=9;
b2=[1 zeros(1,D-1) -1];
a2=1;
b3=b2;
a3=a1;
b4=conv(b3,b3);
a4=conv(a3,a3);
b5=conv(b4,b3);
a5=conv(a4,a3);
b6=conv(b4,b4);
a6=conv(a4,a4);
b7=conv(b6,b3);
a7=conv(a6,a3);
figure(1);
freqz(b7/D^5,a7,'whole');



%CIC抽取滤波器
% 抽取因子
r = 2;                 
hm = mfilt.cicdecim(r);  
%原始的采样率 44.1kHz.
fs = 44.1e3; 
%10240个采样点
n = 0:10239;           
%原始信号
x  = sin(2*pi*1e3/fs*n);  
%得到抽取后的5120个采样点
y_fi = filter(hm,x);        
x = double(x);
y = double(y_fi);
y = y/max(abs(y));
figure(2);
stem(n(1:44)/fs,x(2:45)); hold on;  
stem(n(1:22)/(fs/r),y(3:24),'r','filled'); 
xlabel('时间(sec)');ylabel('信号值');
title('CIC抽取滤波器');


%CIC内插滤波器
%插值因子
R = 2;                    
hm = mfilt.cicinterp(R);
% 原始采样频率:22.05 kHz.
fs = 22.05e3;           
% 5120个采样点
n = 0:5119;              
%原始信号
x = sin(2*pi*1e3/fs*n);    
y_fi = filter(hm,x);  
x = double(x);
y = double(y_fi);
y = y/max(abs(y));
figure(3);
stem(n(1:22)/fs,x(1:22),'filled'); hold on;
stem(n(1:44)/(fs*R),y(4:47),'r');  
xlabel('时间(sec)');ylabel('信号值');
title('CIC内插滤波器');

仿真与说明

1.1 MATLAB设计说明

这个CIC滤波器的频率特性,如果上图,上图和梳子比较相似。所以称为梳状滤波器。

    这个是CIC抽取滤波器,如图可以看到,每2个点抽取一个点,达到抽取效果。

    这个是CIC内插滤波器,如图可以看到,每2个点插入一个点,达到抽取效果。

1.2 FPGA设计说明

    一般在实际应用中,我们多半设计抽取滤波器用的更多,一般抽取滤波器如下所示:

在这里,我们将其中一些参数具体化,设计一个具体参数的CIC滤波器。

我们将这个系统模块话,然后在实际应用的时候,我们只要改变其中的参数就可以了。

系统分为如下三个模块。

       

模块一的设计:

delay_one(

                i_clk,//输入时钟

                i_rst,//输入复位信号

                i_data,//输入信号

                o_data//输出信号

                );

模块二的设计:

down(

           i_clk,//输入时钟

           i_rst,//输入复位信号

           i_M,  //抽取值

           i_data,//输入信号

           o_data//输出信号

           );

模块三的设计:

delay_M(

              i_clk,//输入时钟

              i_rst,//输入复位信号

              i_data,//输入信号

              o_data//输出信号

              );

那么其在顶层,我们只要调用这些模块就行了。

其中CIC积分器输出结果如下所示:

系统滤波输出结果如下所示:

可以看到,滤波后的效果。

当改变CIC级数的时候,就能得到不同效果的CIC滤波器

      检验CIC滤波器最快的方法就是输入一个阶跃信号,这里我们输入的阶跃信号是00FFFFFF,最终通过CIC滤波器的效果如dataout,通过查看相关文献资料,阶跃信号信号通过CIC滤波器后的效果为:

     

  

其效果和我们FPGA设计得到的效果基本相同。

 以上是输入随机信号后滤波效果,显然,其波形特性得到了改善。

A01-23

以上是关于520 666 信号抽取的主要内容,如果未能解决你的问题,请参考以下文章

有没有啥芯片可以把数字视频信号RGB666 RGB656或者RGB888转换成CVBS信号 ?

利用css js写一个简单520祝福。

利用css js写一个简单520祝福。

利用css js写一个简单520祝福。

模拟信号如何转为数字信号?

520 钻石争霸赛 2021 7-7 约会大作战