SignalProcessing - Maple Programming Help

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

SignalProcessing

 FlatTopWindow
 multiply an array of samples by a flat top windowing function

 Calling Sequence FlatTopWindow(A)

Parameters

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

Options

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

Description

 • The FlatTopWindow(A) command multiplies the Array A by the flat top windowing function and returns the result in an Array having the same length.
 • The flat top windowing function $w\left(k\right)$ is defined as follows for a sample with $N$ points.

$w\left(k\right)=0.21557895-0.41663158\mathrm{cos}\left(\frac{2k\mathrm{\pi }}{n}\right)+0.277263158\mathrm{cos}\left(\frac{4k\mathrm{\pi }}{n}\right)-0.083578947\mathrm{cos}\left(\frac{6k\mathrm{\pi }}{n}\right)+0.006947368\mathrm{cos}\left(\frac{8k\mathrm{\pi }}{n}\right)$

 • 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[FlatTopWindow] command is 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{FlatTopWindow}\left(a\right)$
 $\left[\begin{array}{cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc}{0.000331376381891807}& {-}{0.000250028811508094}& {0.000426821592388359}& {-}{0.000402303641131960}& {0.0000172673298707711}& {-}{0.00000620338826360342}& {0.0000987547374294814}& {-}{0.000362187135549589}& {-}{0.0000694489786786052}& {-}{0.000110032423522554}& {0.000391891803145034}& {-}{0.000342097230012349}& {0.000437534564401158}& {0.000417376871497021}& {0.000523272154887617}& {-}{0.000618948041030015}& {0.000252301277361554}& {0.000233838699309746}& {-}{0.0000939548009365754}& {-}{0.0000192474937432478}& {0.000453933228688734}& {0.000453696423844913}& {-}{0.000679277474826819}& {-}{0.000386704857514982}& {-}{0.000971964511240509}& {0.000589500147649631}& {0.00100275642498859}& {-}{0.000433329445926830}& {0.000871463804386630}& {-}{0.000433493201733426}& {0.0000751805944363465}& {0.000690750722760224}& {-}{0.00115767140039705}& {0.000781649647308165}& {-}{0.00114018087556508}& {-}{0.00165573778497130}& {0.00131262760340021}& {0.000609834549716129}& {-}{0.00158912792646192}& {-}{0.00185115765882621}& {0.00207322062738827}& {0.00149876212151349}& {0.00111803601263445}& {-}{0.00182039491496645}& {0.00180722424960328}& {-}{0.00121217794093832}& {-}{0.00113631137625993}& {0.00136729102162173}& {0.000458606926944452}& {0.00284021861709843}& {0.00176430005335296}& {-}{0.00269642743793036}& {-}{0.00283132156092525}& {0.00189425243536611}& {0.00268748347107670}& {-}{0.00155419038648620}& {0.00126719520285421}& {-}{0.00162696118350321}& {-}{0.00110986729710846}& {0.000516300464796003}& {-}{0.00101649495630703}& {0.00227511667475444}& {0.00381345196616759}& {0.000798564547527427}& {0.000589031460554959}& {0.000947220016628260}& {0.00305536467275776}& {-}{0.00288869325760772}& {0.00554428647381081}& {-}{0.00452219930149181}& {0.00609830349002604}& {0.00102934329313278}& {0.00389006495816143}& {0.00457043067075740}& {-}{0.00356184600534371}& {0.00400809998565082}& {-}{0.00304358747522897}& {-}{0.00698270518780385}& {0.00472993621297046}& {0.00340593033259077}& {-}{0.00718844623361521}& {0.00762367950255648}& {-}{0.00904977790800934}& {-}{0.00259369091011177}& {0.00932999470887909}& {-}{0.00616576906720130}& {-}{0.00527074414090313}& {-}{0.00718568319337179}& {-}{0.00535425334026593}& {0.00864630419359357}& {-}{0.00939282207129626}& {0.00615215944089290}& {-}{0.00361117278366093}& {-}{0.000854913116677751}& {0.00397769027730067}& {0.00625724876963413}& {-}{0.00889041100070534}& {-}{0.00908838589726340}& {-}{0.0125152437235487}& {0.00531698254168289}& {\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{FlatTopWindow}\left(\mathrm{Array}\left(1..N,'\mathrm{fill}'=1,'\mathrm{datatype}'={'\mathrm{float}'}_{8},'\mathrm{order}'='\mathrm{C_order}'\right),'\mathrm{container}'=c\right)$
 $\left[\begin{array}{cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc}{-}{0.000422018056381146}& {-}{0.000424919914207619}& {-}{0.000429758639124486}& {-}{0.000436537672526521}& {-}{0.000445261829537942}& {-}{0.000455937296183523}& {-}{0.000468571625752901}& {-}{0.000483173734356250}& {-}{0.000499753895673091}& {-}{0.000518323734894038}& {-}{0.000538896221855361}& {-}{0.000561485663367813}& {-}{0.000586107694739205}& {-}{0.000612779270491646}& {-}{0.000641518654274306}& {-}{0.000672345407971525}& {-}{0.000705280380007928}& {-}{0.000740345692850651}& {-}{0.000777564729709465}& {-}{0.000816962120436361}& {-}{0.000858563726624819}& {-}{0.000902396625909985}& {-}{0.000948489095471339}& {-}{0.000996870594738509}& {-}{0.00104757174730180}& {-}{0.00110062432202858}& {-}{0.00115606121338741}& {-}{0.00121391642098124}& {-}{0.00127422502829123}& {-}{0.00133702318063334}& {-}{0.00140234806232914}& {-}{0.00147023787309374}& {-}{0.00154073180364147}& {-}{0.00161387001051325}& {-}{0.00168969359012682}& {-}{0.00176824455205360}& {-}{0.00184956579152294}& {-}{0.00193370106115890}& {-}{0.00202069494195109}& {-}{0.00211059281346270}& {-}{0.00220344082328016}& {-}{0.00229928585570668}& {-}{0.00239817549970371}& {-}{0.00250015801608496}& {-}{0.00260528230396600}& {-}{0.00271359786647383}& {-}{0.00282515477572148}& {-}{0.00294000363705188}& {-}{0.00305819555255555}& {-}{0.00317978208386781}& {-}{0.00330481521425032}& {-}{0.00343334730996298}& {-}{0.00356543108093125}& {-}{0.00370111954071567}& {-}{0.00384046596578906}& {-}{0.00398352385412911}& {-}{0.00413034688313138}& {-}{0.00428098886685152}& {-}{0.00443550371258317}& {-}{0.00459394537677850}& {-}{0.00475636782032106}& {-}{0.00492282496315764}& {-}{0.00509337063829730}& {-}{0.00526805854518825}& {-}{0.00544694220247981}& {-}{0.00563007490017937}& {-}{0.00581750965121454}& {-}{0.00600929914240992}& {-}{0.00620549568488913}& {-}{0.00640615116391270}& {-}{0.00661131698816276}& {-}{0.00682104403848624}& {-}{0.00703538261610771}& {-}{0.00725438239032433}& {-}{0.00747809234569531}& {-}{0.00770656072873824}& {-}{0.00793983499414625}& {-}{0.00817796175053817}& {-}{0.00842098670575699}& {-}{0.00866895461172975}& {-}{0.00892190920890398}& {-}{0.00917989317027534}& {-}{0.00944294804502259}& {-}{0.00971111420176424}& {-}{0.00998443077145383}& {-}{0.0102629355899315}& {-}{0.0105466651401452}& {-}{0.0108356544940636}& {-}{0.0111299372542936}& {-}{0.0114295454954247}& {-}{0.0117345097051144}& {-}{0.0120448587249381}& {-}{0.0123606196910184}& {-}{0.0126818179744559}& {-}{0.0130084771215814}& {-}{0.0133406187940479}& {-}{0.0136782627087864}& {-}{0.0140214265778424}& {-}{0.0143701260481191}& {-}{0.0147243746410458}& {\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[FlatTopWindow] command was introduced in Maple 18.
 • For more information on Maple 18 changes, see Updates in Maple 18.