UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cross - correlation of two sine signals using xilinx blockset

Reply
Observer
Posts: 37
Registered: ‎12-28-2010

cross - correlation of two sine signals using xilinx blockset

I took a sin wave block and took the coefficients of them and made and reversal of those coefficients and used them in fir complier as coefficients and then connected the same sine wave block to fir complier and was not getting the output . it is always showing zero.

 

please help me 

waiting for your reply

 mahadev

Xilinx Employee
Xilinx Employee
Posts: 3,116
Registered: ‎11-28-2007

Re: cross - correlation of two sine signals using xilinx blockset

If you can attach your model, that'll be very helpful.

Cheers,
Jim
Observer
Posts: 37
Registered: ‎12-28-2010

Re: cross - correlation of two sine signals using xilinx blockset

can u plz me in other prob where i need  to find the max value  and its index of the signal using xilinx blickset

Xilinx Employee
Posts: 451
Registered: ‎08-01-2007

Re: cross - correlation of two sine signals using xilinx blockset

You could do this with a counter and a simple comparator. You just compare the current value against the largest saved value and when you find a higher value you store it in a RAM along with its count. And just repeat until you finish traversing your data set.
Chris
Video Design Hub | Embedded SW Support

---------------------------------------------------------------------------
Don’t forget to Reply, Kudo, and Accept as Solution.
---------------------------------------------------------------------------
Observer
Posts: 37
Registered: ‎12-28-2010

Re: cross - correlation of two sine signals using xilinx blockset

max_index123.JPG

actually what is the prob is i am having some values which are not a number ie is nan so the comparator was showing the error bool type output port op gets inderminate value and also sending u the model as attachment and also u can see the models above one and below one it is getting input from DAFIR with a latency of 14 so forst 14 values are nan's.
and values of input  are
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
-0.0009
-0.0018
-0.0025
-0.003
-0.0032
-0.0032
-0.002
-0.0026
-0.0179
-0.0484
-0.0857
-0.125
-0.1575
-0.1782
-0.1817
-0.1642
-0.1243
-0.0623
0.0183
0.1113
0.2091
0.3044
0.3868
0.4482
0.4815
0.4815
0.4452
0.3724
0.2663
0.1326
-0.0213
-0.1835
-0.3417
-0.4839
-0.5991
-0.6775
-0.7116
-0.6971
-0.6331
-0.522
-0.3697
-0.1857
0.0171
0.2257
0.4267
0.604
0.7446
0.8377
0.8749
0.8528
0.7709
0.6338
0.45
0.2313
-0.0083
-0.2523
-0.4838
-0.6861
-0.8442
-0.9472
-0.9871
-0.9593
-0.8656
-0.7123
-0.5082
-0.2661
-0.0028
0.2648
0.5173
0.7382
0.9107
1.0227
1.0657
1.0367
0.9368
0.7717
0.5528
0.294
0.0122
-0.2724
-0.5404
-0.7724
-0.9537
-1.0717
-1.1164
-1.0858
-0.981
-0.8091
-0.5818
-0.3127
-0.0212
0.2728
0.5502
0.792
0.9808
1.1037
1.1511
1.121
1.0144
0.8385
0.6053
0.3298
0.0298
-0.2731
-0.5575
-0.8038
-0.9963
-1.1219
-1.1709
-1.14
-1.0324
-0.8542
-0.6178
-0.3391
-0.0372
0.2682
0.5555
0.8058
1.0023
1.1305
1.1825
1.154
1.0477
0.8699
0.6328
0.3525
0.0462
-0.2613
-0.536
-0.7579
-0.9179
-1.0077
-1.027
-0.9774
-0.8662
-0.7055
-0.508
-0.2895
-0.0654
0.1484
0.3409
0.4983
0.614
0.6816
0.7004
0.6729
0.6031
0.4984
0.3676
0.2223
0.072
-0.0734
-0.2043
-0.313
-0.3944
-0.4451
-0.4635
-0.4496
-0.408
-0.3435
-0.2613
-0.1677
-0.0698
0.0259
0.1122
0.1853
0.2406
0.2762
0.2919
0.2875
0.2653
0.2277
0.179
0.1225
0.0627
0.0037
-0.0498
-0.0953
-0.1317
-0.1558
-0.1679
-0.1691
-0.1594
-0.1403
-0.1151
-0.0852
-0.0537
-0.0225
0.0074
0.033
0.0538
0.0692
0.0784
0.0817
0.0808
0.0757
CODE FOR ALL MODELS ARE:

XLMAX4:

function [t_max, out2] = xlmax4(out1,max,t_max_i,clk) 

%t_max=0; 

% count=0; 

  

if(out1 >= max) 

%     count=count+1; 

    t_max=clk; 

    out2 = out1; 

else

%     count=count+1;

    t_max = t_max_i;

    out2 = max;

end

 

XLMAX5:

function [t_max] = xlmax5(Lin1, clk, t_max_i)

%t_max=0;

% count=0;

 

if(Lin1 == 1)

%     count=count+1;

    t_max = clk;

   

else

%     count=count+1;

    t_max = t_max_i;

  

end

 

XLMAX6:

function [X_corr_o] = xlmax6(Lin1, X_corr_i,X_corr_d)

%t_max=0;

% count=0;

 

if(Lin1 == 1)

%     count=count+1;

    X_corr_o = X_corr_i;

   

else

%     count=count+1;

   

    X_corr_o = X_corr_d;  

end

 

max_index12.JPG

 

Xilinx Employee
Posts: 79
Registered: ‎05-23-2008

Re: cross - correlation of two sine signals using xilinx blockset

Hi Consisder using an assert block and if you are having Nan consider use of a register with an enable and make use of a valid signal

 

Mike

Xilinx Employee
Posts: 79
Registered: ‎05-23-2008

Re: cross - correlation of two sine signals using xilinx blockset

Hi

the DA filter does have a valid output. So use this with enabled register

 

Mike