关键词不能为空

当前您在: 主页 > 英语 >

walsh变换matlab仿真-word2003

作者:高考题库网
来源:https://www.bjmy2z.cn/gaokao
2021-03-01 12:11
tags:

-

2021年3月1日发(作者:儿童鞋)


Open walshhadamarddemo.m in the Editor



Run in the Command Window



Discrete Walsh- Hadamard Transform


Contents


?



?



?



?



?



Introduction



Walsh (or Hadamard) Functions



Discrete Walsh- Hadamard Transform



Walsh- Transform Applications



References



Introduction


The Walsh- Hadamard transform (WHT) is a suboptimal, non- sinusoidal,


orthogonal transformation that decomposes a signal into a set of


orthogonal, rectangular waveforms called Walsh functions. The


transformation has no multipliers and is real because the amplitude of


Walsh (or Hadamard) functions has only two values, +1 or -1.


WHTs are used in many different applications, such as power spectrum


analysis,


filtering,


processing


speech


and


medical


signals,


multiplexing


and


coding


in


communications,


characterizing


non-linear


signals,


solving


non-linear differential equations, and logical design and analysis.


This demo provides an overview of the Walsh-Hadamard transform and some


of its properties by showcasing two applications, communications using


spread spectrum and processing of ECG signals.


Walsh (or Hadamard) Functions


Walsh


functions


are


rectangular


or


square


waveforms


with


values


of


-1


or


+1. An important characteristic of Walsh functions is sequency which is


determined


from


the


number


of


zero-crossings


per


unit


time


interval.


Every


Walsh function has a unique sequency value.


Walsh functions can be generated in many ways (see [1]). Here we use the


hadamard function


in MATLAB? to generate Walsh functions. Length eight


Walsh functions are generated as follows.


N = 8; % Length of Walsh (Hadamard) functions


hadamardMatrix = hadamard(N)


hadamardMatrix =



1 1 1 1 1 1 1 1


1 -1 1 -1 1 -1 1 -1


1 1 -1 -1 1 1 -1 -1


1 -1 -1 1 1 -1 -1 1


1 1 1 1 -1 -1 -1 -1


1 -1 1 -1 -1 1 -1 1


1 1 -1 -1 -1 -1 1 1


1 -1 -1 1 -1 1 1 -1



The rows (or columns) of the symmetric hadamardMatrix contain the Walsh


functions. The Walsh functions in the matrix are not arranged in


increasing order of their sequencies or number of zero-crossings (i.e.


'sequency


order')


but


are


arranged


in


'Hadamard


order'.


The


Walsh


matrix,


which contains the Walsh functions along the rows or columns in the


increasing order of their sequencies is obtained by changing the index


of the hadamardMatrix as follows.


HadIdx = 0:N-1; % Hadamard index


M = log2(N)+1; % Number of bits to represent


the index


Each column of the sequency index (in binary format) is given by the


modulo-2


addition


of


columns


of


the


bit-reversed


Hadamard


index


(in


binary


format).


binHadIdx


=


fliplr(dec2bin(HadIdx,M))-'0';


%


Bit


reversing


of


the


binary


index


binSeqIdx = zeros(N,M-1); % Pre-allocate memory


for k = M:-1:2


% Binary sequency index


binSeqIdx(:,k) = xor(binHadIdx(:,k),binHadIdx(:,k-1));


end


SeqIdx = binSeqIdx*pow2((M-1:-1:0)'); % Binary to integer sequency


index


walshMatrix = hadamardMatrix(SeqIdx+1,:) % 1-based indexing


walshMatrix =



1 1 1 1 1 1 1 1


1 1 1 1 -1 -1 -1 -1


1 1 -1 -1 -1 -1 1 1


1 1 -1 -1 1 1 -1 -1


1 -1 -1 1 1 -1 -1 1


1 -1 -1 1 -1 1 1 -1


1 -1 1 -1 -1 1 -1 1


1 -1 1 -1 1 -1 1 -1



Discrete Walsh-Hadamard Transform


The forward and inverse


Walsh transform pair


for a signal


x(t) of length


N are




Fast algorithms, similar to the Cooley-Tukey algorithm, have been


developed to implement the Walsh-Hadamard transform with complexity


O(NlogN)


(see


[1]


and


[2]).


Since


the


Walsh


matrix


is


symmetric,


both


the


forward and inverse transformations are identical operations except for


the scaling factor of 1/N. The functions fwht and ifwht implement the


forward and the inverse WHT respectively.


Example 1


Perform WHT on the Walsh matrix. The expected result is an


identity matrix because the rows (or columns) of the symmetric Walsh


matrix contain the Walsh functions.


y1 = fwht(walshMatrix) % Fast Walsh-Hadamard transform


y1 =



1 0 0 0 0 0 0 0


0 1 0 0 0 0 0 0


0 0 1 0 0 0 0 0


0 0 0 1 0 0 0 0


0 0 0 0 1 0 0 0


0 0 0 0 0 1 0 0


0 0 0 0 0 0 1 0


0 0 0 0 0 0 0 1



Example


2



Construct


a


discontinuous


signal


by


scaling


and


adding


arbitrary


columns


of


the


Hadamard


matrix.


This


signal


is


formed


using


weighted


Walsh


functions,


so


the


WHT


should


return


non-zero


values


equal


to


the


weights


at


the


respective


sequency


indices.


While


evaluating


the


WHT,


the


ordering


is specified as 'hadamard', because a Hadamard matrix (instead of the


Walsh matrix) is used to obtain the Walsh functions.


N = 8;


H = hadamard(N); % Hadamard matrix


% Construct a signal by adding a few weighted Walsh functions


x = 8.*H(1,:) + 12.*H(3,:) + 18.*H(5,:) + 10.*H(8,:);


y = fwht(x,N,'hadamard')


y =



8 0 12 0 18 0 0 10



WHT is a reversible transform and the original signal can be recovered


perfectly using the inverse transform. The norm between the original


signal and the signal obtained from inverse transformation equals zero,


indicating perfect reconstruction.


xHat = ifwht(y,N,'hadamard');


norm(x-xHat)


ans =



0



The Walsh-Hadamard transform involves expansion using a set of


rectangular waveforms, so it is useful in applications involving


discontinuous signals that can be readily expressed in terms of Walsh


functions. Below are two applications of Walsh-Hadamard transforms.


Walsh-Transform Applications


ECG


signal


processing



Often,


it


is


necessary


to


record


electro-cardiogram


(ECG)


signals


of


patients


at


different


instants


of


time.


This


results


in


a


large


amount


of


data,


which


needs


to


be


stored


for


analysis,


comparison,


etc.


at


a


later


time.


Walsh-Hadamard


transform


is


suitable


for


compression


of ECG signals because it offers advantages such as fast computation of


Walsh-Hadamard coefficients, less required storage space since it


suffices


to


store


only


those


sequency


coefficients


with


large


magnitudes,


and fast signal reconstruction.


An


ECG


signal


and


its


corresponding


Walsh-Hadamard


transform


is


evaluated


and shown below.


x1 = ecg(512); % Single ecg wave


x = repmat(x1,1,8);


x = x + 0.1.*randn(1,length(x)); % Noisy ecg signal


y = fwht(x); % Fast Walsh-Hadamard transform


figure('Color','white');


subplot(2,1,1);


plot(x);


xlabel('Sample index');


ylabel('Amplitude');


title('ECG Signal');


subplot(2,1,2);


plot(abs(y))


xlabel('Sequency index');


ylabel('Magnitude');


title('WHT Coefficients');



As


can


be


seen


in


the


above


plot,


most


of


the


signal


energy


is


concentrated


at


lower


sequency


values.


For


investigation


purposes,


only


the


first


1024


coefficients are stored and used to reconstruct the original signal.

-


-


-


-


-


-


-


-



本文更新与2021-03-01 12:11,由作者提供,不代表本网站立场,转载请注明出处:https://www.bjmy2z.cn/gaokao/688165.html

walsh变换matlab仿真-word2003的相关文章

  • 余华爱情经典语录,余华爱情句子

    余华的经典语录——余华《第七天》40、我不怕死,一点都不怕,只怕再也不能看见你——余华《第七天》4可是我再也没遇到一个像福贵这样令我难忘的人了,对自己的经历如此清楚,

    语文
  • 心情低落的图片压抑,心情低落的图片发朋友圈

    心情压抑的图片(心太累没人理解的说说带图片)1、有时候很想找个人倾诉一下,却又不知从何说起,最终是什么也不说,只想快点睡过去,告诉自己,明天就好了。有时候,突然会觉得

    语文
  • 经典古训100句图片大全,古训名言警句

    古代经典励志名言100句译:好的药物味苦但对治病有利;忠言劝诫的话听起来不顺耳却对人的行为有利。3良言一句三冬暖,恶语伤人六月寒。喷泉的高度不会超过它的源头;一个人的事

    语文
  • 关于青春奋斗的名人名言鲁迅,关于青年奋斗的名言鲁迅

    鲁迅名言名句大全励志1、世上本没有路,走的人多了自然便成了路。下面是我整理的鲁迅先生的名言名句大全,希望对你有所帮助!当生存时,还是将遭践踏,将遭删刈,直至于死亡而

    语文
  • 三国群英单机版手游礼包码,三国群英手机单机版攻略

    三国群英传7五神兽洞有什么用那是多一个武将技能。青龙飞升召唤出东方的守护兽,神兽之一的青龙。玄武怒流召唤出北方的守护兽,神兽之一的玄武。白虎傲啸召唤出西方的守护兽,

    语文
  • 不收费的情感挽回专家电话,情感挽回免费咨询

    免费的情感挽回机构(揭秘情感挽回机构骗局)1、牛牛(化名)向上海市公安局金山分局报案,称自己为了挽回与女友的感情,被一家名为“实花教育咨询”的情感咨询机构诈骗4万余元。

    语文