function y_cum = cum2x (x,y, maxlag, nsamp, overlap, flag)
%CUM2X Cross-covariance
% y_cum = cum2x (x,y,maxlag, samp_seg, overlap, flag)
% x,y - data vectors/matrices with identical dimensions
% if x,y are matrices, rather than vectors, columns are
% assumed to correspond to independent realizations,
% overlap is set to 0, and samp_seg to the row dimension.
% maxlag - maximum lag to be computed [default = 0]
% samp_seg - samples per segment [default = data_length]
% overlap - percentage overlap of segments [default = 0]
% overlap is clipped to the allowed range of [0,99].
標簽:
cum2x
y_cum
Cross-covariance
function
上傳時間:
2015-09-08
上傳用戶:xieguodong1234
該程序模擬UNIX中save與resume函數,并介紹在VC中如何使用匯編進行機器級的操作.
主函數很簡單首先引入兩個外部函數,extern "C"表示按傳統C命名習慣.函數save將程序指針保存在(*s)中并返回0,為什么有
if(save(&sp)){...}
if后的語句看起來永遠都不會被執行,但是運行結果表明它被執行了.這個問題同UNIX中處理機調度函數(switch)的那個if語句(第一句)一樣.
程序執行完save(&sp)后得到因為條件為假而執行else語句,卻在判斷之前將程序指針保存在sp中了.
else語句中的resume(&sp),該函數很狡猾將堆棧中的返回地址改變了,改到了sp所指出,即將程序指針改到了執行條件判斷前.resume返回1,條件滿足,執行if語句.
save函數堆棧:
eip ebp+8
s ebp+4
ebp ebp+0
resume函數堆棧與save的相同.
新建一個win32的工程,將unixc.cpp和unix.obj加入過程即可.
unix.obj是用masm6.11生成的:ml /c /coff unix.asm,生成coff格式的obj而不是omf格式.
標簽:
save
resume
extern
函數
上傳時間:
2015-09-10
上傳用戶:變形金剛