Cody

# Problem 150. chirp again

Solution 2180255

Submitted on 28 Mar 2020
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   Fail
accu=10^6; f = 10000; fs=48000; your_chirp=round(chirping(f,fs)*accu)/accu; y_correct = round(chirp(0:1/fs:1-1/fs, 0,1,f,'linear',-90)*accu)/accu; assert(isequal(your_chirp,y_correct))

y = Columns 1 through 14 0 14 55 123 218 341 491 668 873 1104 1364 1650 1963 2304 Columns 15 through 28 2673 3068 3491 3941 4418 4922 5454 6013 6599 7213 7854 8522 9217 9940 Columns 29 through 42 10690 11467 12272 13103 13962 14848 15762 16703 17671 18666 19688 20738 21815 22919 Columns 43 through 56 24050 25209 26395 27608 28848 30116 31411 32733 34082 35458 36862 38292 39750 41235 Columns 57 through 70 42748 44287 45853 47447 49068 50716 52390 54092 55822 57578 59361 61171 63008 64872 Columns 71 through 84 66764 68682 70627 72599 74598 76624 78677 80756 82863 84996 87156 89342 91556 93796 Columns 85 through 98 96063 98356 100676 103023 105396 107796 110222 112675 115154 117659 120191 122749 125333 127944 Columns 99 through 112 130580 133243 135932 138646 141387 144154 146946 149765 152609 155478 158373 161294 164241 167212 Columns 113 through 126 170209 173232 176279 179352 182450 185573 188721 191893 195090 198312 201559 204830 208125 211445 Columns 127 through 140 214789 218157 221548 224964 228404 231867 235354 238864 242398 245955 249535 253138 256764 260412 Columns 141 through 154 264083 267777 271493 275231 278991 282773 286577 290402 294249 298117 302006 305916 309847 313798 Columns 155 through 168 317770 321762 325774 329806 333858 337930 342020 346130 350258 354406 358572 362756 366958 371178 Columns 169 through 182 375416 379671 383943 388232 392538 396860 401199 405553 409923 414309 418709 423125 427555 432000 Columns 183 through 196 436458 440931 445417 449916 454428 458952 463489 468038 472599 477171 481754 486347 490951 495565 Columns 197 through 210 500189 504822 509464 514114 518773 523440 528114 532796 537484 542178 546878 551584 556296 561012 Columns 211 through 224 565732 570456 575184 579915 584648 589384 594121 598860 603599 608339 613079 617819 622557 627294 Columns 225 through 238 632029 636762 641491 646218 650940 655658 660370 665078 669779 674474 679161 683841 688513 693176 Columns 239 through 252 697830 702473 707107 711729 716340 720939 725525 730097 734656 739200 743728 748242 752738 757218 Columns 253 through 266 761680 766123 770548 774953 779338 783702 788044 792365 796662 800936 805185 809410 813608 817781 Columns 267 through 280 821927 826045 830134 834194 838225 842225 846193 850130 854034 857904 861740 865541 869306 873035 Columns 281 through 294 876727 880380 883995 887571 891106 894599 898052 901461 904827 908149 911426 914657 917841 920978 Columns 295 through 308 924067 927107 930097 933037 935925 938761 941544 944273 946948 949567 952129 954635 957083 959472 Columns 309 through 322 961801 964070 966278 968424 970506 972526 974480 976370 978193 979949 981638 983257 984808 986288 Columns 323 through 336 987697 989034 990298 991489 992606 993647 994613 995501 996313 997045 997699 998273 998766 999177 Columns 337 through 350 999507 999753 999915 999993 999985 999891 999711 999443 999086 998640 998105 997479 996761 995952 Columns 351 through 364 995050 994055 992966 991781 990502 989126 987654 986085 984417 982651 980785 978820 976754 974587 Columns 365 through 378 972319 969948 967475 964898 962218 959433 956544 953549 950448 947241 943927 940506 936977 933341 Columns 379 through 392 929596 925742 921779 917706 913523 909230 904827 900313 895688 890951 886102 881142 876070 870886 Columns 393 through 406 865589 860179 854657 849022 843274 837413 831439 825352 819152 812839 806412 799873 793221 786455 Columns 407 through 420 779577 772586 765483 758268 750940 743501 735949 728287 720513 712629 704634 696529 688315 679991 Columns 421 through 434 671559 663018 654370 645614 636751 627783 618708 609529 600246 590859 581369 571777 562083 552289 Columns 435 through 448 542396 532403 522313 512125 501841 491462 480989 470422 459764 449014 438175 427247 416231 405129 Columns 449 through 462 393942 382671 371317 359882 348368 336774 325104 313358 301538 289645 277681 265648 253547 241379 Columns 463 through 476 229147 216852 204496 192080 179607 167078 154495 141860 129174 116441 103661 90836 77970 65063 Columns 477 through 490 52118 39137 26122 13076 0 -13103 -26231 -39382 -52554 -65743 -78948 -92167 -105396 -118634 Columns 491 through 504 -131878 -145125 -158373 -171620 -184863 -198098 -211325 -224539 -237739 -250921 -264083 -277223 -290337 -303422 Columns 505 through 518 -316477 -329498 -342481 -355426 -368327 -381184 -393992 -406749 -419452 -432098 -444684 -457207 -469664 -482052 Columns 519 through 532 -494369 -506610 -518773 -530856 -542854 -554765 -566586 -578314 -589945 -601477 -612907 -624231 -635447 -646551 Columns 533 through 546 -657540 -668411 -679161 -689787 -700287 -710656 -720891 -730991 -740951 -750769 -760441 -769965 -779338 -788556 Columns 547 through 560 -797617 -806517 -815254 -823825 -832226 -840456 -848510 -856387 -864083 -871595 -878921 -886058 -893003 -899754 Columns 561 through 574 -906308 -912661 -918813 -924759 -930498 -936026 -941342 -946443 -951326 -955989 -960431 -964647 -968637 -972399 Columns 575 through 588 -975929 -979226 -982287 -985112 -987697 -990041 -992142 -993998 -995608 -996970 -998081 -998941 -999548 -999901 Columns 589 through 602 -999998 -999838 -999419 -998741 -997801 -996600 -995136 -993409 -991416 -989158 -986634 -983844 -980785 -977459 Columns 603 through 616 -973865 -970001 -965869 -961468 -956798 -951858 -946649 -941171 -935425 -929410 -923126 -916575 -909758 -902673 Columns 617 through 630 -895323 -887709 -879830 -871689 -863285 -854622 -845699 -836518 -827081 -817388 -807443 -797247 -786800 -776107 Columns 631 through 644 -765167 -753985 -742561 -730898 -718999 -706866 -694501 -681909 -669090 -656049 -642788 -629310 -615618 -601717 Columns 645 through 658 -587609 -573297 -558786 -544079 -529179 -514091 -498819 -483366 -467737 -451936 -435968 -419836 -403545 -387101 Columns 659 through 672 -370507 -353768 -336890 -319877 -302734 -285466 -268079 -250578 -232968 -215255 -197443 -179540 -161550 -143479 Columns 673 through 686 -125333 -107118 -88840 -70505 -52118 -33687 -15217 3286 21815 40363 58925 77494 96063 114626 Columns 687 through 700 133175 151706 170209 188680 207111 225496 243827 262097 280300 298429 316477 334437 352301 370063 Columns 701 through 714 387717 405254 422668 439951 457098 474100 490951 507644 524172 540527 556703 ...

Undefined function 'chirp' for input arguments of type 'double'. Error in Test1 (line 3) y_correct = round(chirp(0:1/fs:1-1/fs, 0,1,f,'linear',-90)*accu)/accu;

2   Fail
accu=10^6; f = 3650; fs=44000; your_chirp=round(chirping(f,fs)*accu)/accu; y_correct = round(chirp(0:1/fs:1-1/fs, 0,1,f,'linear',-90)*accu)/accu; assert(isequal(your_chirp,y_correct))

y = Columns 1 through 14 0 6 24 53 95 148 213 290 379 480 592 717 853 1001 Columns 15 through 28 1161 1333 1516 1712 1919 2138 2369 2612 2867 3133 3412 3702 4004 4318 Columns 29 through 42 4644 4981 5331 5692 6065 6450 6847 7256 7676 8108 8553 9009 9477 9956 Columns 43 through 56 10448 10951 11467 11994 12533 13083 13646 14221 14807 15405 16015 16637 17270 17916 Columns 57 through 70 18573 19242 19923 20616 21321 22037 22766 23506 24258 25022 25797 26585 27384 28195 Columns 71 through 84 29018 29853 30700 31558 32428 33310 34204 35110 36027 36957 37898 38851 39815 40792 Columns 85 through 98 41780 42780 43792 44816 45851 46898 47957 49028 50111 51205 52311 53429 54559 55700 Columns 99 through 112 56853 58018 59195 60383 61583 62795 64019 65254 66501 67760 69030 70312 71606 72912 Columns 113 through 126 74229 75558 76899 78251 79615 80990 82378 83776 85187 86609 88043 89488 90945 92414 Columns 127 through 140 93894 95386 96889 98404 99931 101469 103018 104579 106152 107736 109332 110939 112557 114188 Columns 141 through 154 115829 117482 119146 120822 122510 124208 125918 127640 129372 131117 132872 134639 136417 138206 Columns 155 through 168 140007 141819 143642 145476 147322 149179 151047 152926 154816 156718 158630 160554 162489 164435 Columns 169 through 182 166392 168359 170338 172328 174329 176341 178363 180397 182441 184497 186563 188640 190728 192826 Columns 183 through 196 194935 197055 199186 201327 203479 205642 207815 209998 212193 214397 216613 218838 221074 223321 Columns 197 through 210 225577 227845 230122 232410 234707 237016 239334 241662 244001 246349 248708 251076 253455 255843 Columns 211 through 224 258242 260650 263068 265496 267933 270380 272837 275303 277779 280265 282760 285264 287778 290302 Columns 225 through 238 292834 295376 297927 300487 303056 305635 308222 310818 313424 316038 318661 321293 323933 326583 Columns 239 through 252 329240 331907 334582 337265 339957 342657 345365 348082 350807 353540 356281 359030 361787 364552 Columns 253 through 266 367324 370105 372893 375688 378491 381302 384120 386946 389778 392618 395465 398319 401181 404049 Columns 267 through 280 406924 409805 412694 415589 418490 421398 424313 427234 430161 433094 436033 438978 441930 444887 Columns 281 through 294 447849 450818 453792 456771 459756 462746 465742 468743 471748 474759 477774 480794 483819 486849 Columns 295 through 308 489883 492921 495964 499011 502061 505116 508175 511238 514304 517374 520447 523524 526604 529687 Columns 309 through 322 532773 535862 538954 542048 545146 548245 551347 554452 557558 560666 563777 566889 570003 573118 Columns 323 through 336 576235 579353 582472 585592 588714 591836 594958 598081 601205 604329 607453 610577 613701 616825 Columns 337 through 350 619948 623071 626193 629314 632434 635554 638672 641788 644904 648017 651129 654239 657346 660452 Columns 351 through 364 663555 666655 669753 672848 675940 679029 682114 685196 688274 691349 694420 697486 700549 703606 Columns 365 through 378 706660 709708 712752 715790 718823 721851 724873 727890 730900 733905 736903 739895 742880 745858 Columns 379 through 392 748829 751793 754750 757699 760641 763574 766500 769417 772326 775226 778118 781000 783873 786737 Columns 393 through 406 789591 792436 795270 798095 800909 803713 806506 809287 812058 814818 817566 820302 823026 825739 Columns 407 through 420 828438 831126 833800 836462 839111 841746 844368 846975 849569 852149 854714 857265 859801 862322 Columns 421 through 434 864828 867318 869792 872251 874693 877119 879529 881922 884298 886656 888998 891321 893627 895915 Columns 435 through 448 898184 900435 902667 904880 907074 909248 911403 913538 915653 917747 919821 921874 923906 925917 Columns 449 through 462 927907 929874 931820 933743 935644 937523 939378 941211 943020 944805 946567 948305 950018 951707 Columns 463 through 476 953371 955010 956624 958213 959776 961313 962823 964308 965765 967196 968600 969976 971325 972646 Columns 477 through 490 973939 975204 976440 977648 978826 979975 981095 982185 983245 984275 985275 986244 987182 988089 Columns 491 through 504 988965 989809 990621 991401 992150 992865 993548 994198 994814 995398 995947 996463 996945 997392 Columns 505 through 518 997805 998183 998526 998833 999106 999342 999543 999707 999836 999927 999982 1000000 999981 999924 Columns 519 through 532 999829 999697 999527 999318 999071 998785 998460 998096 997693 997250 996768 996245 995683 995080 Columns 533 through 546 994436 993752 993027 992260 991453 990603 989712 988780 987805 986788 985728 984626 983481 982293 Columns 547 through 560 981062 979787 978469 977108 975702 974253 972759 971221 969638 968011 966339 964622 962860 961053 Columns 561 through 574 959200 957302 955357 953368 951332 949250 947122 944947 942726 940458 938144 935782 933374 930918 Columns 575 through 588 928416 925866 923268 920623 917931 915190 912402 909566 906682 903750 900770 897741 894664 891539 Columns 589 through 602 888365 885142 881872 878552 875184 871766 868301 864786 861222 857609 853948 850237 846477 842669 Columns 603 through 616 838811 834904 830948 826943 822888 818785 814632 810430 806180 801880 797531 793132 788685 784189 Columns 617 through 630 779644 775050 770407 765715 760975 756185 751347 746461 741526 736542 731510 726430 721302 716125 Columns 631 through 644 710900 705628 700307 694939 689524 684060 678550 672992 667388 661736 656037 650292 644500 638662 Columns 645 through 658 632778 626848 620872 614850 608783 602671 596514 590311 584064 577773 571437 565058 558634 552167 Columns 659 through 672 545657 539103 532507 525868 519187 512464 505699 498892 492045 485156 478227 471257 464247 457198 Columns 673 through 686 450109 442981 435814 428609 421366 414085 406766 399411 392019 384590 377126 369626 362090 354520 Columns 687 through 700 346916 339277 331605 323900 316161 308391 300588 292755 284890 276994 269068 261113 253128 245115 Columns 701 through 714 237073 229003 220906 212783 204633 196457 188256 180030 171779 163505 155208 ...

Undefined function 'chirp' for input arguments of type 'double'. Error in Test2 (line 3) y_correct = round(chirp(0:1/fs:1-1/fs, 0,1,f,'linear',-90)*accu)/accu;

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!