Cody

Solution 106686

Submitted on 5 Jul 2012 by Vitaly Lavrukhin
  • Size: 11
  • This is the leading solution.
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Pass
%% y = sin(2*pi*(0:0.0001:0.9999)*100)' + randn(10000,1); z = filt(y); assert((sin(2*pi*(0:0.0001:0.9999)*100)*z/norm(sin(2*pi*(0:0.0001:0.9999)*100))/norm(z))>0.95)

ans = 1.295049119166158 -0.125524367793599 0.556340998412282 0.396490446641920 0.530671060524859 0.618707033059491 0.582870144717946 0.644520122128274 0.631083985091196 0.645373448841063 0.722892592256471 0.744643447011348 0.771645719191512 0.822355893119660 0.867507469326160 0.811282623076140 0.856969653593166 0.900956354640907 0.853479591586216 0.834763501539282 0.828096188626547 0.815613783380661 0.773703483753381 0.813133613059319 0.807934258178615 0.750996025681656 0.829073747868346 0.775589252130227 0.748009027262272 0.793184626410277 0.750415067299693 0.720635950465054 0.722082465205732 0.720438318620909 0.628834201741925 0.526777748545785 0.467186875025376 0.465098308045009 0.493003322241279 0.460498600984461 0.458455018673070 0.435615660683244 0.420455091017450 0.442042387252284 0.424162182218396 0.434733644419070 0.399657007464516 0.389267488628613 0.380784957751564 0.319066620421366 0.279930700530653 0.255728791230557 0.223385609801633 0.220674957756736 0.187450905874670 0.076484262366248 0.102516959834361 0.087435601638166 -0.081313101584696 -0.105809245099347 -0.125991697729367 -0.146419876467255 -0.178457603773814 -0.137705637361868 -0.117358327735178 -0.157841416856524 -0.156757910592048 -0.245892125702786 -0.257968545966934 -0.336145319036485 -0.374638242296173 -0.407683727046517 -0.466912959315073 -0.426177964880581 -0.446295258645494 -0.425973350131763 -0.480167623786698 -0.536336171545953 -0.498731814587053 -0.435106713286276 -0.467081378296042 -0.487421236512356 -0.419583042783016 -0.431294231231318 -0.433450278458404 -0.428270289589949 -0.479766959833478 -0.414632492348458 -0.362186990281788 -0.295816798234575 -0.279216489322982 -0.296179605853128 -0.246361587636769 -0.169156492466413 -0.145786122002183 -0.099281616718951 -0.050830067996435 -0.035202495887313 0.010156620401981 0.053659037513380 0.060705285792891 0.020448648148748 0.077118468388805 0.178019520596319 0.266230341011912 0.351709974424676 0.447539454202845 0.452929659332258 0.518191974995449 0.578832478869980 0.585211758629148 0.529567467431579 0.591175627378104 0.721863795053039 0.740231962029398 0.806642501323127 0.820733359167597 0.864044863118461 0.948511515013180 0.978041983987864 1.016278949423597 1.053668736889970 0.949683369782842 0.983707938308086 0.994843704152428 0.995132550751108 1.000515650662408 0.916802246725430 0.925494201244661 0.980343669796574 1.040813050535460 0.977202222081169 0.880008479798318 0.815889262552577 0.811350749979209 0.743836242205563 0.730681755003748 0.666856019441854 0.655175899403551 0.637638422760433 0.651634897555627 0.568867418481716 0.433654046774784 0.437393574733022 0.388138752646478 0.348363990107804 0.238622821871330 0.127897429152945 0.072955691420595 0.017532886562176 -0.063928636728309 -0.062429688079229 -0.084506732829557 -0.146456411615823 -0.130877551407287 -0.171003533463022 -0.107348402388750 -0.144005459960576 -0.211927278610817 -0.246366979969211 -0.344876739192119 -0.398758641593137 -0.509574002990432 -0.497582317837314 -0.548526322697743 -0.550357937475319 -0.597171636584114 -0.624632121258132 -0.570264794182155 -0.654266825442247 -0.613167422871065 -0.598742194022487 -0.558601422712897 -0.546654254097202 -0.502729091067401 -0.540512068260377 -0.517926897284125 -0.499869724720513 -0.505670366636164 -0.486711611194123 -0.516441002114052 -0.564648533484750 -0.550439880076673 -0.630112885637495 -0.628147252300108 -0.639481746849885 -0.645232208806313 -0.671473667077687 -0.682291287812874 -0.621077220588736 -0.550812769812819 -0.376154203656052 -0.407201886926369 -0.408663255186787 -0.317991965822370 -0.211909102502674 -0.198231703997902 -0.224458330656638 -0.046741534065798 0.000778084391329 -0.029792360357267 -0.069509486494730 -0.030634430724849 -0.053348812859427 -0.020808976047200 0.012029853286587 0.078552687991352 0.128181424121576 0.205608612902187 0.377572146637448 0.509804305241154 0.590830617273234 0.639760002501246 0.655027140602597 0.722150862478968 0.808264408273639 0.784751131845837 0.856451025155153 0.939118496936310 0.959384982051805 0.972996408066319 1.046642485111894 1.116751876099816 1.090238181153144 1.022869580060195 1.032800484799821 1.078342590756199 0.931761363847376 0.880691443064975 0.956459206968886 1.023894224177442 1.097418326466864 1.140707112525075 1.197461776298087 1.124089131211404 1.023545519365582 0.981722264694479 0.865674089526690 0.748856460844903 0.692631404130315 0.550009142199613 0.582418428710684 0.576991717616939 0.503981437460474 0.411387753848139 0.459005411785522 0.412516155093726 0.400261349305420 0.347335061604617 0.182215326156514 0.070847683322506 -0.004449751756503 -0.152013981744905 -0.132724911648329 -0.154989342741217 -0.233006073036208 -0.182208333573700 -0.214086420078548 -0.235279745912587 -0.359716079096297 -0.497193213621676 -0.560916215569115 -0.617467079218967 -0.597059060236237 -0.665000137755206 -0.684099059390016 -0.639567780800508 -0.676955242485110 -0.743823843564217 -0.628883536559041 -0.685246654658904 -0.696968678420934 -0.756366485414899 -0.800585733346744 -0.829325467068044 -0.931915341364084 -1.056806205613208 -1.103461696068043 -1.051288293913040 -1.021737210495511 -0.970487942156885 -0.931007945304772 -0.944280348518306 -0.908908477860533 -0.868684061128980 -0.927035458244113 -0.823286315147229 -0.883670068787840 -0.819425874999076 -0.760652482855700 -0.759500371958539 -0.787585092775235 -0.747370723287652 -0.659315398433748 -0.609516852863466 -0.607416919515656 -0.519221521521342 -0.471673615099888 -0.516558661602889 -0.523739498220273 -0.463359229237365 -0.330051204983807 -0.224019332683159 -0.175161476245182 -0.026529262644802 0.097343003250143 0.206052674978694 0.205429148207357 0.252238882221317 0.248996340336201 0.350790575489429 0.389306183708220 0.407591664440400 0.447013243281569 0.514145197547447 0.464003497121807 0.515226527370764 0.524196116767796 0.591849729924586 0.681151272360045 0.714553080141788 0.708439464408885 0.728459637891829 0.730673699229320 0.762450007464800 0.695924652267709 0.713847597872922 0.753183990548080 0.723714862308004 0.747987688964695 0.693876665139397 0.574609508846644 0.565326005483571 0.546127776895772 0.504910651183911 0.489810802805156 0.493426136421829 0.413129912208546 0.405289266687300 0.377019150732156 0.353593953902825 0.232803895314839 0.090140201992283 0.068039408216320 0.023720975458132 0.030170301002985 0.027358540595453 -0.013183440700212 -0.016819903775282 -0.065761523831261 -0.110106562589033 -0.077662329662965 -0.062870274088727 -0.165123883011088 -0.140281653894021 -0.222590932078163 -0.290247545067237 -0.255762709830803 -0.303869430643386 -0.353009354429639 -0.333607124969889 -0.394193402702804 -0.460142740240124 -0.461935794627295 -0.487944079534673 -0.554264924031951 -0.546259779143710 -0.510265334972774 -0.523409079719584 -0.567531449173772 -0.509617437562558 -0.423711561977421 -0.428803170653184 -0.437791382195952 -0.466149984236814 -0.471580312918799 -0.529820939488160 -0.625199020940861 -0.548678970478719 -0.554688427135415 -0.610124956336117 -0.682894983248183 -0.670200841654529 -0.698342615707288 -0.622692804232260 -0.664502848898450 -0.632605287128782 -0.671025041172252 -0.651609912964315 -0.617724725490672 -0.570911289675982 -0.550569407829821 -0.546989182040209 -0.569606348920376 -0.436884375776749 -0.436669734500429 -0.430008621403252 -0.407522606584514 -0.346099105801467 -0.343187591696306 -0.300153280619403 -0.252834791329807 -0.178321698118673 -0.122736584192329 -0.075359719340807 -0.014156529957682 0.050950347043622 0.112650526089957 0.218991825522189 0.288611079850274 0.342241109273572 0.465432820199353 0.527262069521723 0.497966701935284 0.582953722234580 0.630268610958075 0.710132075259682 0.683219214202893 0.746420475873092 0.762930600494287 0.837988156566328 0.864153905572967 0.922785202673225 0.912816000316289 0.975259163563531 0.965791344641461 0.935946755385760 0.954636454051538 0.980376429669014 0.981526784535039 0.975960906829374 0.990468639451188 0.932988971209491 0.865001429626598 0.778878244266089 0.774423855961359 0.703410777016088 0.595039230244783 0.548339210661857 0.557179850033886 0.507054728083214 0.481466685550859 0.507034091011071 0.458825134215327 0.360979314431523 0.322436190709525 0.362317426096851 0.296166786410641 0.296362957135711 0.240754065716360 0.226650597223311 0.098031388262266 0.007794213336749 -0.051679940899439 -0.121634334923711 -0.142385838285474 -0.277275157815460 -0.337453213930278 -0.423203563355200 -0.477231210811489 -0.535338066144682 -0.590180281815001 -0.591266277974626 -0.588536869122463 -0.615898228282957 -0.649373042973202 -0.621580075161605 -0.628622965835663 -0.689111040374745 -0.728793700679190 -0.809800397336922 -0.831568501457984 -0.794543243358382 -0.793187272545576 -0.883001036548367 -0.8658875844051...

2   Pass
%% y = chirp(0:0.0001:0.9999,50,1,150)' + randn(10000,1); z = filt(y); assert((chirp(0:0.0001:0.9999,50,1,150)*z/norm(chirp(0:0.0001:0.9999,50,1,150))/norm(z))>0.95)

ans = -1.217082640057913 0.067470055038734 0.245341785715612 0.260757451652993 0.387429687761286 0.533793652074586 0.703209448130852 0.759852930968373 0.871900785794899 0.932300078097850 0.928099504444968 0.897859139177961 0.973369143383629 0.957966062238952 0.894072090644047 0.961719907692658 0.910372851183790 1.014993445862356 1.049499137779367 1.032735332814044 1.073090496405855 1.074255645483634 1.042289905098166 1.061082784740899 1.060749790561673 1.027591781884614 1.030872631901599 1.001938142716658 0.973949510771096 0.932617093112237 0.896998736297916 0.813566774727087 0.758693901994984 0.700263260607875 0.719268117784377 0.678177369328464 0.698825952717598 0.633451099954009 0.462154353887182 0.378894179439418 0.288757760484989 0.300885127754653 0.293169949261003 0.292117367531374 0.330813256377817 0.315445507589174 0.235058413328873 0.217128407746563 0.169966802557080 0.125504806561657 0.070515956495190 0.025527287797525 -0.021877960078691 -0.093096083529246 -0.132372565091935 -0.163481951200109 -0.278416293080428 -0.329595784788401 -0.286208029153765 -0.337319557802104 -0.339816344175366 -0.326273062434430 -0.436565965810996 -0.538741168482624 -0.632169721258104 -0.655533230907807 -0.633015256092097 -0.597146376544407 -0.588789191227262 -0.549595578638134 -0.555363746522811 -0.515880602920127 -0.593702080476333 -0.686748090214888 -0.700023130160855 -0.743001600984518 -0.806565353775276 -0.859641899841346 -0.925671692786094 -0.886768993544280 -0.868825252332225 -0.921820306638482 -0.962774809156309 -1.042367859327531 -1.079577257657124 -1.052320217853888 -1.097496405634132 -1.167107210922476 -1.102502711447215 -1.120694628545524 -1.132727541318850 -0.984558076799600 -0.909866781134950 -0.823309515650113 -0.841459643741641 -0.893301232449569 -0.924862813203319 -0.903669703520707 -0.969945371035150 -0.984243549396672 -1.033898574958174 -1.042681680962817 -1.058698443276988 -1.062590140409182 -1.012867814565373 -0.925821205318375 -0.917401977113713 -0.894319647400876 -0.974153700594805 -0.929323908194075 -0.873329618979351 -0.834087093150794 -0.769659416243156 -0.735102815892528 -0.736135596601385 -0.693351760403637 -0.639427876416633 -0.664449348992762 -0.705870994689406 -0.710797769587359 -0.668053707749591 -0.747579395176757 -0.707168870683342 -0.684113755809667 -0.711224403801010 -0.644027275967834 -0.609259106344346 -0.558898702816948 -0.556721563034343 -0.564681437179202 -0.539908890989556 -0.464781067090795 -0.422428077997001 -0.406062209016761 -0.457306501167771 -0.439923892027789 -0.358216154186841 -0.217507518229241 -0.262302654042987 -0.264092937819510 -0.207529646972419 -0.221549723496360 -0.257956542936948 -0.189769538526141 -0.132598632557659 -0.151491630516600 -0.086220042663863 -0.026846081323667 -0.032153676841676 -0.085649992642597 0.011497532526945 0.038413073058176 0.082918569312266 0.188853197710619 0.205792960749819 0.169137682382222 0.179977444261687 0.175313061264934 0.200356254765539 0.299272985769407 0.292776462937229 0.326362461768189 0.356511439477180 0.401529618885794 0.502320480485753 0.462092061484996 0.457881639955910 0.498278093439188 0.607720580918561 0.634610460336587 0.674039669821403 0.770741898401390 0.807791687637544 0.821390765974829 0.830903279557952 0.848695940019194 0.835189769215769 0.894593180631492 0.897619319460118 0.893933627395073 0.823278792610904 0.814435016004008 0.759056438942409 0.773298573075369 0.816810166558454 0.849827610104751 0.908969017184698 0.995152477903301 0.963737717782876 0.943285940034225 0.906646104361428 0.847094026389686 0.860067071757662 0.867485746775976 0.822042372646248 0.804359613628106 0.825494462684001 0.762561720832758 0.684491348745473 0.763398542794984 0.725821990700489 0.680958361728083 0.636412918268309 0.662712174922713 0.677419136421848 0.676329296093647 0.615833675339035 0.604766207726599 0.621386796589337 0.617020517867313 0.654451676857229 0.703416943595537 0.697373244108654 0.681374817429303 0.664560525805169 0.609868564381286 0.504482842511045 0.535988852639904 0.541620341118408 0.520883198969903 0.555932451227287 0.480253995774276 0.415155623377428 0.466239078259541 0.440453899431760 0.444539246498087 0.396613237299381 0.467273374685718 0.371973720219122 0.329170519662596 0.309894123894957 0.328746422994952 0.334847239898343 0.286700790554289 0.233577221759310 0.292798780299078 0.271990993426865 0.274333568553869 0.292930894371757 0.261408966470305 0.214193610440889 0.146907998002331 0.123197472318223 0.144439099824452 0.136394239499714 0.170866792385753 0.093585865633803 0.080904551017681 0.038268564016368 0.048846415750209 0.082405922508322 0.052989441032607 0.025152973000647 -0.000688329599975 -0.155544773907571 -0.168752813834009 -0.189292676418278 -0.137265882055599 -0.175834110072818 -0.208249337265953 -0.259969016807408 -0.331199672295521 -0.373391952461079 -0.326297968130461 -0.375807142657751 -0.326808569365602 -0.421422648897068 -0.465787778516432 -0.494587855703092 -0.566004425158367 -0.647616242271001 -0.664897397035887 -0.788688875214500 -0.822059966165734 -0.861339119262818 -0.882444008146302 -0.841445232903798 -0.815268100446480 -0.828244892091541 -0.884666557818850 -0.881053745635121 -0.902095277195297 -0.884127430366552 -0.841757401134568 -0.843390093183527 -0.855409767044476 -0.925974947322982 -0.955191256836595 -0.930008475782401 -0.964086946578453 -0.924322160129710 -0.949608599882318 -0.985531959263081 -0.956484523653717 -0.986306959757989 -0.924158487715442 -0.890979079441364 -0.928118617702984 -0.869486421882472 -0.722466176139936 -0.762569330086252 -0.681780027381359 -0.681415589177641 -0.609458303562326 -0.553274472043086 -0.641868394046843 -0.665529505901791 -0.725222791713239 -0.692135570419933 -0.622506352187614 -0.634753380551038 -0.615482089316764 -0.590576433556757 -0.587762503128676 -0.641540262435881 -0.598895419529810 -0.576302062841796 -0.619076963059537 -0.538115745759410 -0.503152628028977 -0.455695493972065 -0.446825735179695 -0.463849246909044 -0.465739249355987 -0.449928637388008 -0.410682946726814 -0.421575759057519 -0.339708938107125 -0.316972494688671 -0.159085186556133 -0.172324130339983 -0.108390345464571 -0.165961305294746 -0.234417648404344 -0.157808297502906 -0.068606507659122 -0.048407400561485 0.004561341714187 -0.007014971525443 0.110783070785180 0.146017617946841 0.213054596507474 0.301474861206252 0.355601808913984 0.407408233700781 0.526644898088777 0.574186617087844 0.554220151986882 0.597750218199793 0.643278305685940 0.718516366448513 0.726830122827435 0.749648970875384 0.729626601730166 0.714713506051973 0.827809715575895 0.817627739566300 0.801035985224757 0.746093068835525 0.891483408771857 0.917186728386499 0.917246081748976 0.948840861229152 0.994654511194061 0.938529896805802 0.972888430622347 1.021094376177764 1.005516770980010 1.042198160425286 1.053160722092536 1.061427797259992 1.033616253472717 1.041310494521402 1.053706621332704 0.987796103624873 1.022542544485566 1.080900262583910 1.097500975387377 1.099474356355891 1.111963917527980 1.151418296598228 1.132610703850251 1.200157884296629 1.141361808734387 1.110505810438614 1.101993985684718 1.197124130477950 1.217940328374591 1.142923011386026 1.121651486226652 1.117869451217215 1.156259459439205 1.121903597530404 1.193047966923679 1.200328247651058 1.123740647872947 1.181881573008954 1.087538819967635 1.035515741102480 1.033869675511677 1.030295467218894 1.053687061259350 1.009170419908407 1.009361547981616 1.050063623670053 1.016160910308256 0.936635809951199 0.918159147884314 0.960355288641760 0.941465207473028 0.942925501138419 0.844766527171695 0.848662043397231 0.789370867221224 0.757571709945625 0.602888819644437 0.573963656397051 0.512560597212346 0.451342737868038 0.419293287460655 0.405640536419066 0.362477100079135 0.344586764536053 0.329115145541941 0.303390313303926 0.237715768725793 0.190701041457126 0.163018952227258 0.092090069249345 0.073772129234713 0.035121368602311 0.039538959704654 0.035773869043446 -0.057843632064882 -0.077254571330624 -0.150054865993144 -0.215335562142664 -0.298740370252259 -0.383354296267800 -0.368101882664752 -0.312807444234348 -0.297137698158368 -0.310332753317861 -0.299484128959682 -0.311033116683733 -0.350510509282811 -0.341894664222647 -0.340477024922217 -0.353509054960453 -0.364782454794913 -0.388726765531839 -0.506151136758211 -0.533756555542172 -0.533545376226086 -0.571463056227431 -0.589830433208223 -0.549285469821911 -0.582730583208024 -0.521524765220708 -0.543559673774447 -0.632586517295858 -0.685806941042601 -0.682711540309416 -0.729184374181362 -0.694434290007402 -0.703599409145886 -0.778738739890771 -0.772495169349721 -0.866597006031245 -0.945397857587852 -1.005952846864724 -1.016186612884868 -1.041373323240257 -1.053654897069400 -1.061701615824798 -1.0774594317197...