SignalProcessing - Maple Programming Help

Home : Support : Online Help : Science and Engineering : Signal Processing : Windowing Functions : SignalProcessing/TukeyWindow

SignalProcessing

 TukeyWindow
 multiply an array of samples by a Tukey windowing function
 TaperedCosineWindow
 multiply an array of samples by a tapered cosine windowing function

 Calling Sequence TukeyWindow( A, alpha ) TaperedCosineWindow( A, alpha )

Parameters

 A - Array of real or complex numeric values; the signal alpha - real numeric constant

Options

 • container : Array, predefined Array for holding results
 • inplace : truefalse, specifies that output should overwrite input

Description

 • The TukeyWindow( A, alpha ) command multiplies the Array A by the Tukey windowing function, with parameter $\mathrm{\alpha }$, and returns the result in an Array having the same length.
 • The command TaperedCosineWindow( A, alpha ) is provided as an alias.
 • The Tukey windowing function $w\left(k\right)$ with parameter $\mathrm{\alpha }$ is defined as follows for a sample with $N$ points.

$w\left(k\right)=\left\{\begin{array}{cc}\frac{1}{2}-\frac{\mathrm{cos}\left(\frac{2\mathrm{\pi }k}{\mathrm{\alpha }N}\right)}{2}& k<\frac{\mathrm{\alpha }N}{2}\\ \frac{1}{2}-\frac{\mathrm{cos}\left(\frac{2\mathrm{\pi }}{\mathrm{\alpha }}-\frac{2\mathrm{\pi }k}{\mathrm{\alpha }N}\right)}{2}& N-\frac{1}{2}\mathrm{\alpha }N

 • Before the code performing the computation runs, A is converted to datatype float[8] or complex[8] if it does not have one of those datatypes already. For this reason, it is most efficient if A has one of these datatypes beforehand. This does not apply if inplace is true.
 • If the container=C option is provided, then the results are put into C and C is returned. With this option, no additional memory is allocated to store the result. The container must be an Array of the same size and datatype as A.
 • If the inplace or inplace=true option is provided, then A is overwritten with the results. In this case, the container option is ignored.

 • The SignalProcessing[TukeyWindow] and SignalProcessing[TaperedCosineWindow] commands are thread-safe as of Maple 18.

Examples

 > $\mathrm{with}\left(\mathrm{SignalProcessing}\right):$
 > $N≔1024:$
 > $a≔\mathrm{GenerateUniform}\left(N,-1,1\right)$
 ${a}{≔}\left[\begin{array}{cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc}{-}{0.785218492150308}& {0.588413964957000}& {-}{0.993165822699668}& {0.921578288543971}& {-}{0.0387801709584892}& {0.0136057925410569}& {-}{0.210756972897798}& {0.749600215815009}& {0.138966357801110}& {0.212285134010017}& {-}{0.727212007157506}& {0.609271531458945}& {-}{0.746508821379394}& {-}{0.681121068540962}& {-}{0.815677223727108}& {0.920580454170705}& {-}{0.357731881551445}& {-}{0.315850691869855}& {0.120832127984613}& {0.0235598362050951}& {-}{0.528712330386043}& {-}{0.502768306992949}& {0.716167932841928}& {0.387918812688441}& {0.927826197817923}& {-}{0.535605234093965}& {-}{0.867390423081817}& {0.356968106236309}& {-}{0.683916721958668}& {0.324222652241588}& {-}{0.0536105097271503}& {-}{0.469822424929590}& {0.751377623062582}& {-}{0.484332469291986}& {0.674785583745689}& {0.936373751610519}& {-}{0.709695004858078}& {-}{0.315371678676457}& {0.786426438484342}& {0.877079485449941}& {-}{0.940901432652028}& {-}{0.651838099118323}& {-}{0.466202749870718}& {0.728111944627018}& {-}{0.693676937371493}& {0.446705075912178}& {0.402212079148740}& {-}{0.465064398013056}& {-}{0.149959974456579}& {-}{0.893211717717351}& {-}{0.533857398666442}& {0.785364017821850}& {0.794103573076428}& {-}{0.511805256363005}& {-}{0.699780572205783}& {0.390154657885433}& {-}{0.306801157072187}& {0.380043311044574}& {0.250223507639021}& {-}{0.112387157976628}& {0.213712436612696}& {-}{0.462156727444381}& {-}{0.748708907514812}& {-}{0.151586118619889}& {-}{0.108139840420336}& {-}{0.168242880143225}& {-}{0.525201478973032}& {0.480703854002059}& {-}{0.893447801005097}& {0.705915172118695}& {-}{0.922403736039998}& {-}{0.150907000061125}& {-}{0.552928699180485}& {-}{0.630023401696236}& {0.476304094772787}& {-}{0.520089327357710}& {0.383331325836480}& {0.853844197466971}& {-}{0.561684322543443}& {-}{0.392888241447509}& {0.805707171559335}& {-}{0.830475841183217}& {0.958363623823972}& {0.267084791325033}& {-}{0.934454344213010}& {0.600780255626888}& {0.499754573684187}& {0.663151745684446}& {0.481067702174187}& {-}{0.756487140897663}& {0.800444356631489}& {-}{0.510770577006043}& {0.292151435278357}& {0.0674125049263240}& {-}{0.305776782333851}& {-}{0.469037371221931}& {0.649966387543828}& {0.648178403731437}& {0.870920942630620}& {-}{0.361100737471134}& {\mathrm{...}}& {"... 924 Array entries not shown"}\end{array}\right]$ (1)
 > $\mathrm{TukeyWindow}\left(a,1.23\right)$
 $\left[\begin{array}{cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc}{-}{0.00000488516489435590}& {0.0000146429631511183}& {-}{0.0000556090888129975}& {0.0000917333843395072}& {-}{0.00000603138179942413}& {0.00000304707771781536}& {-}{0.0000642426592256384}& {0.000298429426501894}& {0.0000700182658048569}& {0.000132044137897508}& {-}{0.000547302006233879}& {0.000545674037317046}& {-}{0.000784619403660583}& {-}{0.000830220516780614}& {-}{0.00114126844326572}& {0.00146541538746017}& {-}{0.000642813216519613}& {-}{0.000636245354180893}& {0.000271177766065394}& {0.0000585816473829466}& {-}{0.00144927372249613}& {-}{0.00151240083783750}& {0.00235441849181993}& {0.00138846233245257}& {0.00360307483835708}& {-}{0.00224942852265249}& {-}{0.00392803268075154}& {0.00173831656352190}& {-}{0.00357216289262104}& {0.00181202732678558}& {-}{0.000319887480288366}& {-}{0.00298676362645246}& {0.00507919310375097}& {-}{0.00347495860311376}& {0.00512965226510307}& {0.00752967609979562}& {-}{0.00602742028667329}& {-}{0.00282474061393524}& {0.00741833802352573}& {0.00870175873628899}& {-}{0.00980588834002660}& {-}{0.00712752279900764}& {-}{0.00534238796646088}& {0.00873471567180287}& {-}{0.00870256596982438}& {0.00585490108839601}& {0.00550237267521508}& {-}{0.00663451384338462}& {-}{0.00222891550670902}& {-}{0.0138207386281675}& {-}{0.00859233874243231}& {0.0131380403302401}& {0.0137970779252513}& {-}{0.00922898639904220}& {-}{0.0130873197516322}& {0.00756268835039146}& {-}{0.00615982183174699}& {0.00789853978749512}& {0.00538002552119007}& {-}{0.00249841201825998}& {0.00490936353914620}& {-}{0.0109647171255199}& {-}{0.0183360637159455}& {-}{0.00383015913151437}& {-}{0.00281769181732582}& {-}{0.00451842859931864}& {-}{0.0145317660816565}& {0.0136967164434250}& {-}{0.0262038299387447}& {0.0213020089010260}& {-}{0.0286274367039904}& {-}{0.00481493052471360}& {-}{0.0181300758061662}& {-}{0.0212213103249889}& {0.0164749616247726}& {-}{0.0184665759424449}& {0.0139668631406416}& {0.0319132477734182}& {-}{0.0215282083769344}& {-}{0.0154371395365861}& {0.0324429021612353}& {-}{0.0342594137413289}& {0.0404913910997547}& {0.0115540190211892}& {-}{0.0413779170748369}& {0.0272226726581476}& {0.0231663275655193}& {0.0314399651805412}& {0.0233200820642173}& {-}{0.0374859633713789}& {0.0405352136454634}& {-}{0.0264274139994079}& {0.0154404463204273}& {0.00363842198000878}& {-}{0.0168499166096141}& {-}{0.0263829451844809}& {0.0373106855867538}& {0.0379637626276776}& {0.0520347556246309}& {-}{0.0220035524697098}& {\mathrm{...}}& {"... 924 row vector entries not shown"}\end{array}\right]$ (2)
 > $c≔\mathrm{Array}\left(1..N,'\mathrm{datatype}'={'\mathrm{float}'}_{8},'\mathrm{order}'='\mathrm{C_order}'\right):$
 > $\mathrm{TukeyWindow}\left(\mathrm{Array}\left(1..N,'\mathrm{fill}'=1,'\mathrm{datatype}'={'\mathrm{float}'}_{8},'\mathrm{order}'='\mathrm{C_order}'\right),0.72,'\mathrm{container}'=c\right)$
 $\left[\begin{array}{cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc}{0.0000181565032162379}& {0.0000726246942305830}& {0.000163400617235465}& {0.000290477679537549}& {0.000453846652036405}& {0.000653495669895032}& {0.000889410233401222}& {0.00116157320902083}& {0.00146996483064221}& {0.00181456270101138}& {0.00219534179335895}& {0.00261227445321777}& {0.00306533040043100}& {0.00355447673135167}& {0.00407967792123204}& {0.00464089582680377}& {0.00523808968904793}& {0.00587121613615549}& {0.00654022918667690}& {0.00724508025286180}& {0.00798571814418758}& {0.00876208907107717}& {0.00957413664880569}& {0.0104218019015953}& {0.0113050232668984}& {0.0122237365998688}& {0.0131778751780202}& {0.0141673697060719}& {0.0151921483209815}& {0.0162521365971643}& {0.0173472575518980}& {0.0184774316509140}& {0.0196425768141738}& {0.0208426084218297}& {0.0220774393203707}& {0.0233469798289521}& {0.0246511377459087}& {0.0259898183554507}& {0.0273629244345429}& {0.0287703562599657}& {0.0302120116155570}& {0.0316877857996367}& {0.0331975716326097}& {0.0347412594647507}& {0.0363187371841674}& {0.0379298902249427}& {0.0395746015754550}& {0.0412527517868767}& {0.0429642189818489}& {0.0447088788633331}& {0.0464866047236384}& {0.0482972674536234}& {0.0501407355520735}& {0.0520168751352508}& {0.0539255499466179}& {0.0558666213667334}& {0.0578399484233192}& {0.0598453878014993}& {0.0618827938542075}& {0.0639520186127656}& {0.0660529117976297}& {0.0681853208293043}& {0.0703490908394238}& {0.0725440646819993}& {0.0747700829448325}& {0.0770269839610924}& {0.0793146038210567}& {0.0816327763840159}& {0.0839813332903399}& {0.0863601039737043}& {0.0887689156734791}& {0.0912075934472746}& {0.0936759601836475}& {0.0961738366149636}& {0.0987010413304170}& {0.101257390789205}& {0.103842699333860}& {0.106456779203730}& {0.109099440548616}& {0.111770491442561}& {0.114469737897790}& {0.117196983878794}& {0.119952031316572}& {0.122734680123012}& {0.125544728205427}& {0.128381971481230}& {0.131246203892752}& {0.134137217422214}& {0.137054802106831}& {0.139998746054059}& {0.142968835456988}& {0.145964854609866}& {0.148986585923768}& {0.152033809942396}& {0.155106305358020}& {0.158203849027548}& {0.161326215988734}& {0.164473179476515}& {0.167644510939479}& {0.170839980056468}& {\mathrm{...}}& {"... 924 row vector entries not shown"}\end{array}\right]$ (3)
 > $u≔{\mathrm{~}}_{\mathrm{log}}\left(\mathrm{FFT}\left(c\right)\right):$
 > $\mathbf{use}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\mathrm{plots}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\mathbf{in}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\mathrm{display}\left(\mathrm{Array}\left(\left[\mathrm{listplot}\left(\mathrm{ℜ}\left(u\right)\right),\mathrm{listplot}\left(\mathrm{ℑ}\left(u\right)\right)\right]\right)\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\mathbf{end use}$

 > 

Compatibility

 • The SignalProcessing[TukeyWindow] and SignalProcessing[TaperedCosineWindow] commands were introduced in Maple 18.