SignalProcessing - Maple Programming Help

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

SignalProcessing

 BlackmanHarrisWindow
 multiply an array of samples by a Blackman-Harris windowing function

 Calling Sequence BlackmanHarrisWindow(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 BlackmanHarrisWindow(A) command multiplies the Array A by the Blackman-Harris windowing function and returns the result in an Array having the same length.
 • The Blackman-Harris windowing function $w\left(k\right)$ is defined as follows for a sample with $N$ points.

$0.35875-0.48829\mathrm{cos}\left(\frac{2k\mathrm{\pi }}{N}\right)+0.14128\mathrm{cos}\left(\frac{4k\mathrm{\pi }}{N}\right)-0.1168\mathrm{cos}\left(\frac{6k\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[BlackmanHarrisWindow] 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{BlackmanHarrisWindow}\left(a\right)$
 $\left[\begin{array}{cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc}{0.0824806524307400}& {-}{0.0617756039775430}& {0.104178085373494}& {-}{0.0965506602979515}& {0.00405647282811414}& {-}{0.00142044835426856}& {0.0219529346343676}& {-}{0.0778744308575297}& {-}{0.0143937532216832}& {-}{0.0219142592649574}& {0.0747917336580222}& {-}{0.0624065305621111}& {0.0761238142522245}& {0.0691217407220990}& {0.0823474344012703}& {-}{0.0924207881636088}& {0.0357005208466391}& {0.0313211990084170}& {-}{0.0119016436233062}& {-}{0.00230404302608164}& {0.0513162245524778}& {0.0484105864959939}& {-}{0.0683819803579608}& {-}{0.0367143498140880}& {-}{0.0870041816271325}& {0.0497397169397316}& {0.0797371249924280}& {-}{0.0324684035770419}& {0.0615196419854699}& {-}{0.0288284654024592}& {0.00470954496242496}& {0.0407559654076850}& {-}{0.0643303145037578}& {0.0409040252490456}& {-}{0.0561838435300986}& {-}{0.0768190243391567}& {0.0573334359193180}& {0.0250732016473538}& {-}{0.0614923563374734}& {-}{0.0674051510899355}& {0.0710221675723113}& {0.0482923455356274}& {0.0338752806105949}& {-}{0.0518493268677664}& {0.0483717761098084}& {-}{0.0304777356017562}& {-}{0.0268265061200714}& {0.0302949949474928}& {0.00953154395925311}& {0.0553390335101635}& {0.0322052393793774}& {-}{0.0460791541110394}& {-}{0.0452607292003966}& {0.0283012831122112}& {0.0374912741673491}& {-}{0.0202228221076674}& {0.0153611364761577}& {-}{0.0183499598756784}& {-}{0.0116300936104145}& {0.00501854537438787}& {-}{0.00914906402541548}& {0.0189241990030956}& {0.0292497020871955}& {0.00563423104258037}& {0.00381226373211082}& {0.00560604058169020}& {0.0164772120245049}& {-}{0.0141373367868492}& {0.0245083998700369}& {-}{0.0179574054093086}& {0.0216136251988598}& {0.00323121069003006}& {0.0107153605714429}& {0.0109211056751082}& {-}{0.00727696449889223}& {0.00687061140175762}& {-}{0.00426739650555197}& {-}{0.00772250480223852}& {0.00390202158176046}& {0.00190188304193490}& {-}{0.00219657886281760}& {0.000501661021206468}& {0.00146178719275567}& {0.000977862408024093}& {-}{0.00542284442246125}& {0.00477660336479234}& {0.00504903188378728}& {0.00813006291827124}& {0.00693711112039781}& {-}{0.0125455732840666}& {0.0150086725584527}& {-}{0.0106848112773013}& {0.00674553435121403}& {0.00170286566030507}& {-}{0.00838809778362648}& {-}{0.0138852734950995}& {0.0206525931650209}& {0.0220023168418557}& {0.0314517321277812}& {-}{0.0138227051788366}& {\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{BlackmanHarrisWindow}\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.105041658156659}& {-}{0.104986638075555}& {-}{0.104894956101401}& {-}{0.104766639468574}& {-}{0.104601726290898}& {-}{0.104400265547355}& {-}{0.104162317063707}& {-}{0.103887951490062}& {-}{0.103577250274370}& {-}{0.103230305631874}& {-}{0.102847220510515}& {-}{0.102428108552314}& {-}{0.101973094050735}& {-}{0.101482311904058}& {-}{0.100955907564755}& {-}{0.100394036984921}& {-}{0.0997968665577408}& {-}{0.0991645730550520}& {-}{0.0984973435609921}& {-}{0.0977953754017764}& {-}{0.0970588760716227}& {-}{0.0962880631548497}& {-}{0.0954831642441801}& {-}{0.0946444168552746}& {-}{0.0937720683375296}& {-}{0.0928663757811698}& {-}{0.0919276059206694}& {-}{0.0909560350345364}& {-}{0.0899519488414962}& {-}{0.0889156423931116}& {-}{0.0878474199628786}& {-}{0.0867475949318361}& {-}{0.0856164896707334}& {-}{0.0844544354187952}& {-}{0.0832617721591292}& {-}{0.0820388484908207}& {-}{0.0807860214977606}& {-}{0.0795036566142538}& {-}{0.0781921274874556}& {-}{0.0768518158366875}& {-}{0.0754831113096809}& {-}{0.0740864113358021}& {-}{0.0726621209763109}& {-}{0.0712106527717063}& {-}{0.0697324265862154}& {-}{0.0682278694494801}& {-}{0.0666974153955004}& {-}{0.0651415052988905}& {-}{0.0635605867085086}& {-}{0.0619551136785188}& {-}{0.0603255465969470}& {-}{0.0586723520117927}& {-}{0.0569960024547586}& {-}{0.0552969762626628}& {-}{0.0535757573965974}& {-}{0.0518328352588981}& {-}{0.0500687045079932}& {-}{0.0482838648711966}& {-}{0.0464788209555128}& {-}{0.0446540820565241}& {-}{0.0428101619654266}& {-}{0.0409475787742872}& {-}{0.0390668546795897}& {-}{0.0371685157841433}& {-}{0.0352530918974236}& {-}{0.0333211163344194}& {-}{0.0313731257130579}& {-}{0.0294096597502808}& {-}{0.0274312610568472}& {-}{0.0254384749309358}& {-}{0.0234318491506225}& {-}{0.0214119337653075}& {-}{0.0193792808861695}& {-}{0.0173344444757209}& {-}{0.0152779801365419}& {-}{0.0132104448992704}& {-}{0.0111323970099233}& {-}{0.00904439571662868}& {-}{0.00694700105584425}& {-}{0.00484077363814157}& {-}{0.00272627443363378}& {-}{0.000604064557123936}& {0.00152529494694612}& {0.00366124331966948}& {0.00580322030289058}& {0.00795066635438636}& {0.0101030228629342}& {0.0122597323631865}& {0.0144202387502747}& {0.0165839874940634}& {0.0187504258529772}& {0.0209190030873193}& {0.0230891706720079}& {0.0252603825086481}& {0.0274320951368644}& {0.0296037679448139}& {0.0317748633788055}& {0.0339448471519456}& {0.0361131884517338}& {0.0382793601465342}& {\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[BlackmanHarrisWindow] command was introduced in Maple 18.