Chào mọi người, sau đây là vấn đề của mình mong các bạn cố gắng giúp mình càng sớm càng tốt , vì mình đang làm đề tài tốt nghiệp.
Mình học CNTT
Giờ mình có một file âm thanh định dạng là *.wave , giả sử mình đã thu âm được một file âm thanh chỉ có một nốt LA(A) có tên file là la.wave.
File la.wave được biểu diễn trong miền thời gian là một tín hiệu dạng sóng, mình đã lấy mẫu được cái file la.wave và lưu vào một mảng trong chương trình máy tính rồi(mảng này mình đặt tên là arrSample).
Sau khi áp dụng thuật toán FFT cho mảng arrSample ở trên mình được mảng kết quả là arrSpectrogram có chiều dài bằng với chiều dài của mảng arrSample.
(File la.wave có tần số lấy mẫu là 16000 Sample/sec, độ dài file là 0.02s)==> độ dài của mảng=0.02*16000=320.
arrSpectrogram[320]=FFT( arrSample[320])= mảng sau:
18.8366277972236 6.90849690866503 18.0590713305149 14.0264083957827 10.9598512972319 33.624897034067 4.6975706947308 46.8418415613134 43.4008501667331 20.0733946715077 179.435090354729 33.4065132865038 430.296134239128 2011.278820711 11849.9455978911 3635.63580637229 272.470104318583 129.833810068748 207.335221562353 3.84874609858226 75.6493577174955 44.759084780299 6.07390225358616 45.2975805498723 7.85899812245982 14.6134931483002 23.3514286636863 0.760836538152539 16.9660964893422 9.11472106858583 2.9292457312821 13.9614690362225 2.08437478062945 6.39280861796485 8.61006520669762 0.513336910742724 7.89697262205675 3.7291930783646 1.87965907477996 6.93204551693433 0.922183791445805 3.7885120963871 4.48779169346747 0.40059314592655 4.70499071550132 2.00227149537494 1.34298613258787 4.2063167755602 0.518439802245439 2.57068636841733 2.76907215301967 0.325223033737003 3.17558918278322 1.24523704864277 1.01981070185407 2.85359322061789 0.334101928577322 1.885377761481 1.88874917345701 0.26956088710057 2.31238445184084 0.849220882440885 0.808340315364086 2.07996450803379 0.235177686685293 1.4552163160458 1.37760169691953 0.228478260927269 1.77356399219434 0.617184989757855 0.660545571946392 1.59277993253818 0.176057813412465 1.16702375989707 1.05327206590473 0.196118020761268 1.41256388884147 0.470758182262195 0.552554789834161 1.26776579232284 0.138040666716312 0.962938926649693 0.835449977769897 0.171172555548775 1.15942090630382 0.372077950676204 0.472007754861689 1.03763249721439 0.111713410082601 0.81230655638262 0.682814398945771 0.150981210297609 0.974245165693663 0.302290294004621 0.409691489006346 0.869985342422797 0.0930130706022342 0.698678507019298 0.570847927658223 0.134748065542888 0.83545616012095 0.251048103450443 0.361058510843033 0.743031425804043 0.0788062450772026 0.610469641294416 0.486445440690484 0.121644930796958 0.725866858226105 0.213513167553871 0.321735252054656 0.64574237606598 0.0683048127359868 0.540392192568239 0.421743199671194 0.110944948343202 0.641667679503842 0.184095604045895 0.290213945211977 0.568624938135476 0.0601242955544407 0.484090393706363 0.370926771371877 0.101797624938405 0.57321845898531 0.161499067516545 0.264560576758301 0.50747344697917 0.05353391636163 0.437823673505572 0.329748865879447 0.0939743066504466 0.51818899183238 0.142973066607461 0.243083217432261 0.457929607177818 0.0481948652146037 0.40087901475623 0.296540985575792 0.0877736655744083 0.472569653014744 0.128058450839136 0.224518493162549 0.417127940367035 0.0441105279270979 0.370080973995756 0.269662348447224 0.0826020825485113 0.435051830950383 0.116101856057224 0.209917744189448 0.383461221445275 0.0405034595787118 0.343767418918416 0.247337407371943 0.0777510548514576 0.404103842119357 0.106063966717703 0.197497641217661 0.354878682819186 0.0374496954613478 0.321940190497001 0.22861915091176 0.0742943760992887 0.377249019642477 0.09812685260035 0.186796051620307 0.331820874759227 0.0353055538001982 0.304252025323721 0.212935267705858 0.0709029967746253 0.355499902729323 0.090687048878675 0.177717734174524 0.311751547184885 0.0330767308653454 0.288389032615068 0.199941009510876 0.0680954016184175 0.337052166334983 0.0850006158678049 0.170212500649029 0.295248729609892 0.0312793945961521 0.275624295508683 0.188709503033791 0.0659321647908285 0.321476343700378 0.0799790677363025 0.163602907579635 0.281428529378706 0.0299652924150535 0.264534275859669 0.17986235329701 0.0641729493321502 0.308141971771396 0.0759626836662476 0.158651270532552 0.269351257366746 0.0287767931341712 0.255692676966175 0.171680925137074 0.0626484767063272 0.297249680223725 0.0726032388502003 0.154750175995756 0.259466542234872 0.0278009753846984 0.248730758938381 0.165421435248359 0.061602138619578 0.288583361964321 0.0693699816230755 0.151441710633613 0.251270306125059 0.0270472981903176 0.242593797645998 0.159493154085094 0.0605979180149426 0.281431158302743 0.0670274526775791 0.148599125619057 0.244998722413107 0.0264156989288918 0.237881277961347 0.155504494550565 0.0601664490204931 0.27574396920786 0.0650419771276312 0.146720850554624 0.240300479056106 0.0259171073151392 0.234852722077103 0.151924405757556 0.0600451580964805 0.272063730778728 0.0632928987180016 0.146090093046913 0.23630401610584 0.0256452216319355 0.23264590785379 0.149406526132328 0.0600575930786062 0.269114551898425 0.0622366624899436 0.145601243070919 0.234017797667335 0.025304828103466 0.232204535904804 0.147368833660016 0.0603437560085804 0.267970722334797 0.0612290999776848 0.146343126862298 0.23240025215806 0.0253090346232057 0.23240025215806 0.146343126862298 0.0612290999776843 0.267970722334797 0.0603437560085802 0.147368833660016 0.232204535904804 0.0253048281034662 0.234017797667336 0.14560124307092 0.0622366624899435 0.269114551898426 0.0600575930786075 0.149406526132334 0.23264590785379 0.0256452216319357 0.236304016105839 0.146090093046912 0.0632928987180019 0.272063730778729 0.0600451580964801 0.151924405757556 0.234852722077103 0.0259171073151394 0.240300479056106 0.146720850554624 0.0650419771276314 0.27574396920786 0.060166449020493 0.155504494550565 0.237881277961345 0.0264156989288918 0.244998722413106 0.148599125619056 0.0670274526775787 0.281431158302743 0.0605979180149429 0.159493154085094 0.242593797645997 0.0270472981903176 0.251270306125059 0.151441710633613 0.0693699816230751 0.288583361964322 0.0616021386195792 0.165421435248361 0.248730758938381 0.0278009753846985 0.259466542234875 0.154750175995757 0.0726032388501977 0.297249680223726 0.0626484767063273 0.171680925137074 0.255692676966176 0.0287767931341712 0.269351257366746 0.158651270532552 0.0759626836662474 0.308141971771396 0.0641729493321495 0.179862353297009 0.264534275859669 0.0299652924150535 0.281428529378707 0.163602907579635 0.0799790677363029 0.321476343700378 0.065932164790829 0.188709503033792 0.275624295508684 0.0312793945961522 0.295248729609891 0.170212500649028 0.0850006158678046 0.337052166334984 0.0680954016184188 0.199941009510878 0.288389032615062 0.0330767308653454 0.311751547184887 0.177717734174521 0.0906870488786745 0.355499902729323 0.0709029967746254 0.212935267705858 0.304252025323721 0.0353055538001982 0.331820874759227 0.186796051620306 0.0981268526003505 0.377249019642478 0.0742943760992883 0.228619150911761 0.321940190496999 0.0374496954613478 0.354878682819187 0.197497641217659 0.106063966717702 0.404103842119357 0.0777510548514574 0.247337407371943 0.343767418918415 0.0405034595787118 0.383461221445275 0.209917744189448 0.116101856057225 0.435051830950384 0.0826020825485111 0.269662348447228 0.370080973995759 0.0441105279270983 0.41712794036704 0.224518493162534 0.128058450839136 0.472569653014745 0.0877736655744081 0.296540985575789 0.40087901475623 0.0481948652146038 0.457929607177819 0.24308321743226 0.142973066607461 0.51818899183238 0.0939743066504457 0.329748865879448 0.437823673505573 0.05353391636163 0.50747344697917 0.264560576758299 0.161499067516544 0.573218458985309 0.101797624938405 0.370926771371876 0.484090393706361 0.0601242955544403 0.568624938135477 0.290213945211979 0.184095604045895 0.641667679503844 0.1109449483432 0.421743199671198 0.540392192568239 0.0683048127359865 0.645742376065976 0.321735252054654 0.21351316755387 0.725866858226103 0.121644930796959 0.486445440690485 0.610469641294416 0.0788062450772025 0.743031425804042 0.361058510843031 0.251048103450442 0.83545616012095 0.134748065542887 0.570847927658224 0.698678507019297 0.0930130706022342 0.8699853424228 0.409691489006346 0.302290294004622 0.974245165693663 0.150981210297608 0.682814398945771 0.812306556382619 0.111713410082601 1.03763249721439 0.472007754861689 0.372077950676204 1.15942090630382 0.171172555548776 0.835449977769896 0.962938926649685 0.138040666716312 1.26776579232286 0.552554789834159 0.470758182262193 1.41256388884147 0.196118020761268 1.05327206590472 1.16702375989707 0.176057813412465 1.59277993253818 0.660545571946392 0.617184989757854 1.77356399219434 0.22847826092727 1.37760169691953 1.4552163160458 0.235177686685293 2.07996450803378 0.808340315364086 0.849220882440886 2.31238445184084 0.269560887100569 1.888749173457 1.88537776148101 0.334101928577322 2.85359322061789 1.01981070185407 1.24523704864277 3.17558918278323 0.325223033737003 2.76907215301967 2.57068636841731 0.51843980224544 4.20631677556021 1.34298613258787 2.00227149537493 4.70499071550132 0.400593145926548 4.48779169346746 3.7885120963871 0.922183791445804 6.93204551693433 1.87965907477995 3.72919307836459 7.89697262205675 0.513336910742722 8.61006520669761 6.39280861796484 2.08437478062945 13.9614690362226 2.9292457312821 9.11472106858584 16.9660964893421 0.760836538152536 23.3514286636863 14.6134931483001 7.85899812245983 45.2975805498723 6.07390225358614 44.7590847802989 75.6493577174955 3.84874609858226 207.335221562353 129.833810068748 272.470104318583 3635.63580637229 11849.9455978911 2011.278820711 430.296134239128 33.4065132865038 179.435090354729 20.0733946715077 43.4008501667331 46.8418415613134 4.69757069473081 33.624897034067 10.9598512972319 14.0264083957827 18.0590713305149 6.90849690866498 .
Vấn đề của mình là dựa vào dữ liệu trong mảng này làm sao để trích ra được tần số của nốt LA đó (=440), và biên độ là bao nhiêu?. cái tần số=440 thì mình đã lấy được rồi(lấy code trên mạng), nhưng còn cái biên độ của nó thì mình ko biết phải làm sao?, ở đây mảng arrSpectrogram là phổ theo biên độ.
hix mong mọi người giúp mình,
Mình học CNTT
Giờ mình có một file âm thanh định dạng là *.wave , giả sử mình đã thu âm được một file âm thanh chỉ có một nốt LA(A) có tên file là la.wave.
File la.wave được biểu diễn trong miền thời gian là một tín hiệu dạng sóng, mình đã lấy mẫu được cái file la.wave và lưu vào một mảng trong chương trình máy tính rồi(mảng này mình đặt tên là arrSample).
Sau khi áp dụng thuật toán FFT cho mảng arrSample ở trên mình được mảng kết quả là arrSpectrogram có chiều dài bằng với chiều dài của mảng arrSample.
(File la.wave có tần số lấy mẫu là 16000 Sample/sec, độ dài file là 0.02s)==> độ dài của mảng=0.02*16000=320.
arrSpectrogram[320]=FFT( arrSample[320])= mảng sau:
18.8366277972236 6.90849690866503 18.0590713305149 14.0264083957827 10.9598512972319 33.624897034067 4.6975706947308 46.8418415613134 43.4008501667331 20.0733946715077 179.435090354729 33.4065132865038 430.296134239128 2011.278820711 11849.9455978911 3635.63580637229 272.470104318583 129.833810068748 207.335221562353 3.84874609858226 75.6493577174955 44.759084780299 6.07390225358616 45.2975805498723 7.85899812245982 14.6134931483002 23.3514286636863 0.760836538152539 16.9660964893422 9.11472106858583 2.9292457312821 13.9614690362225 2.08437478062945 6.39280861796485 8.61006520669762 0.513336910742724 7.89697262205675 3.7291930783646 1.87965907477996 6.93204551693433 0.922183791445805 3.7885120963871 4.48779169346747 0.40059314592655 4.70499071550132 2.00227149537494 1.34298613258787 4.2063167755602 0.518439802245439 2.57068636841733 2.76907215301967 0.325223033737003 3.17558918278322 1.24523704864277 1.01981070185407 2.85359322061789 0.334101928577322 1.885377761481 1.88874917345701 0.26956088710057 2.31238445184084 0.849220882440885 0.808340315364086 2.07996450803379 0.235177686685293 1.4552163160458 1.37760169691953 0.228478260927269 1.77356399219434 0.617184989757855 0.660545571946392 1.59277993253818 0.176057813412465 1.16702375989707 1.05327206590473 0.196118020761268 1.41256388884147 0.470758182262195 0.552554789834161 1.26776579232284 0.138040666716312 0.962938926649693 0.835449977769897 0.171172555548775 1.15942090630382 0.372077950676204 0.472007754861689 1.03763249721439 0.111713410082601 0.81230655638262 0.682814398945771 0.150981210297609 0.974245165693663 0.302290294004621 0.409691489006346 0.869985342422797 0.0930130706022342 0.698678507019298 0.570847927658223 0.134748065542888 0.83545616012095 0.251048103450443 0.361058510843033 0.743031425804043 0.0788062450772026 0.610469641294416 0.486445440690484 0.121644930796958 0.725866858226105 0.213513167553871 0.321735252054656 0.64574237606598 0.0683048127359868 0.540392192568239 0.421743199671194 0.110944948343202 0.641667679503842 0.184095604045895 0.290213945211977 0.568624938135476 0.0601242955544407 0.484090393706363 0.370926771371877 0.101797624938405 0.57321845898531 0.161499067516545 0.264560576758301 0.50747344697917 0.05353391636163 0.437823673505572 0.329748865879447 0.0939743066504466 0.51818899183238 0.142973066607461 0.243083217432261 0.457929607177818 0.0481948652146037 0.40087901475623 0.296540985575792 0.0877736655744083 0.472569653014744 0.128058450839136 0.224518493162549 0.417127940367035 0.0441105279270979 0.370080973995756 0.269662348447224 0.0826020825485113 0.435051830950383 0.116101856057224 0.209917744189448 0.383461221445275 0.0405034595787118 0.343767418918416 0.247337407371943 0.0777510548514576 0.404103842119357 0.106063966717703 0.197497641217661 0.354878682819186 0.0374496954613478 0.321940190497001 0.22861915091176 0.0742943760992887 0.377249019642477 0.09812685260035 0.186796051620307 0.331820874759227 0.0353055538001982 0.304252025323721 0.212935267705858 0.0709029967746253 0.355499902729323 0.090687048878675 0.177717734174524 0.311751547184885 0.0330767308653454 0.288389032615068 0.199941009510876 0.0680954016184175 0.337052166334983 0.0850006158678049 0.170212500649029 0.295248729609892 0.0312793945961521 0.275624295508683 0.188709503033791 0.0659321647908285 0.321476343700378 0.0799790677363025 0.163602907579635 0.281428529378706 0.0299652924150535 0.264534275859669 0.17986235329701 0.0641729493321502 0.308141971771396 0.0759626836662476 0.158651270532552 0.269351257366746 0.0287767931341712 0.255692676966175 0.171680925137074 0.0626484767063272 0.297249680223725 0.0726032388502003 0.154750175995756 0.259466542234872 0.0278009753846984 0.248730758938381 0.165421435248359 0.061602138619578 0.288583361964321 0.0693699816230755 0.151441710633613 0.251270306125059 0.0270472981903176 0.242593797645998 0.159493154085094 0.0605979180149426 0.281431158302743 0.0670274526775791 0.148599125619057 0.244998722413107 0.0264156989288918 0.237881277961347 0.155504494550565 0.0601664490204931 0.27574396920786 0.0650419771276312 0.146720850554624 0.240300479056106 0.0259171073151392 0.234852722077103 0.151924405757556 0.0600451580964805 0.272063730778728 0.0632928987180016 0.146090093046913 0.23630401610584 0.0256452216319355 0.23264590785379 0.149406526132328 0.0600575930786062 0.269114551898425 0.0622366624899436 0.145601243070919 0.234017797667335 0.025304828103466 0.232204535904804 0.147368833660016 0.0603437560085804 0.267970722334797 0.0612290999776848 0.146343126862298 0.23240025215806 0.0253090346232057 0.23240025215806 0.146343126862298 0.0612290999776843 0.267970722334797 0.0603437560085802 0.147368833660016 0.232204535904804 0.0253048281034662 0.234017797667336 0.14560124307092 0.0622366624899435 0.269114551898426 0.0600575930786075 0.149406526132334 0.23264590785379 0.0256452216319357 0.236304016105839 0.146090093046912 0.0632928987180019 0.272063730778729 0.0600451580964801 0.151924405757556 0.234852722077103 0.0259171073151394 0.240300479056106 0.146720850554624 0.0650419771276314 0.27574396920786 0.060166449020493 0.155504494550565 0.237881277961345 0.0264156989288918 0.244998722413106 0.148599125619056 0.0670274526775787 0.281431158302743 0.0605979180149429 0.159493154085094 0.242593797645997 0.0270472981903176 0.251270306125059 0.151441710633613 0.0693699816230751 0.288583361964322 0.0616021386195792 0.165421435248361 0.248730758938381 0.0278009753846985 0.259466542234875 0.154750175995757 0.0726032388501977 0.297249680223726 0.0626484767063273 0.171680925137074 0.255692676966176 0.0287767931341712 0.269351257366746 0.158651270532552 0.0759626836662474 0.308141971771396 0.0641729493321495 0.179862353297009 0.264534275859669 0.0299652924150535 0.281428529378707 0.163602907579635 0.0799790677363029 0.321476343700378 0.065932164790829 0.188709503033792 0.275624295508684 0.0312793945961522 0.295248729609891 0.170212500649028 0.0850006158678046 0.337052166334984 0.0680954016184188 0.199941009510878 0.288389032615062 0.0330767308653454 0.311751547184887 0.177717734174521 0.0906870488786745 0.355499902729323 0.0709029967746254 0.212935267705858 0.304252025323721 0.0353055538001982 0.331820874759227 0.186796051620306 0.0981268526003505 0.377249019642478 0.0742943760992883 0.228619150911761 0.321940190496999 0.0374496954613478 0.354878682819187 0.197497641217659 0.106063966717702 0.404103842119357 0.0777510548514574 0.247337407371943 0.343767418918415 0.0405034595787118 0.383461221445275 0.209917744189448 0.116101856057225 0.435051830950384 0.0826020825485111 0.269662348447228 0.370080973995759 0.0441105279270983 0.41712794036704 0.224518493162534 0.128058450839136 0.472569653014745 0.0877736655744081 0.296540985575789 0.40087901475623 0.0481948652146038 0.457929607177819 0.24308321743226 0.142973066607461 0.51818899183238 0.0939743066504457 0.329748865879448 0.437823673505573 0.05353391636163 0.50747344697917 0.264560576758299 0.161499067516544 0.573218458985309 0.101797624938405 0.370926771371876 0.484090393706361 0.0601242955544403 0.568624938135477 0.290213945211979 0.184095604045895 0.641667679503844 0.1109449483432 0.421743199671198 0.540392192568239 0.0683048127359865 0.645742376065976 0.321735252054654 0.21351316755387 0.725866858226103 0.121644930796959 0.486445440690485 0.610469641294416 0.0788062450772025 0.743031425804042 0.361058510843031 0.251048103450442 0.83545616012095 0.134748065542887 0.570847927658224 0.698678507019297 0.0930130706022342 0.8699853424228 0.409691489006346 0.302290294004622 0.974245165693663 0.150981210297608 0.682814398945771 0.812306556382619 0.111713410082601 1.03763249721439 0.472007754861689 0.372077950676204 1.15942090630382 0.171172555548776 0.835449977769896 0.962938926649685 0.138040666716312 1.26776579232286 0.552554789834159 0.470758182262193 1.41256388884147 0.196118020761268 1.05327206590472 1.16702375989707 0.176057813412465 1.59277993253818 0.660545571946392 0.617184989757854 1.77356399219434 0.22847826092727 1.37760169691953 1.4552163160458 0.235177686685293 2.07996450803378 0.808340315364086 0.849220882440886 2.31238445184084 0.269560887100569 1.888749173457 1.88537776148101 0.334101928577322 2.85359322061789 1.01981070185407 1.24523704864277 3.17558918278323 0.325223033737003 2.76907215301967 2.57068636841731 0.51843980224544 4.20631677556021 1.34298613258787 2.00227149537493 4.70499071550132 0.400593145926548 4.48779169346746 3.7885120963871 0.922183791445804 6.93204551693433 1.87965907477995 3.72919307836459 7.89697262205675 0.513336910742722 8.61006520669761 6.39280861796484 2.08437478062945 13.9614690362226 2.9292457312821 9.11472106858584 16.9660964893421 0.760836538152536 23.3514286636863 14.6134931483001 7.85899812245983 45.2975805498723 6.07390225358614 44.7590847802989 75.6493577174955 3.84874609858226 207.335221562353 129.833810068748 272.470104318583 3635.63580637229 11849.9455978911 2011.278820711 430.296134239128 33.4065132865038 179.435090354729 20.0733946715077 43.4008501667331 46.8418415613134 4.69757069473081 33.624897034067 10.9598512972319 14.0264083957827 18.0590713305149 6.90849690866498 .
Vấn đề của mình là dựa vào dữ liệu trong mảng này làm sao để trích ra được tần số của nốt LA đó (=440), và biên độ là bao nhiêu?. cái tần số=440 thì mình đã lấy được rồi(lấy code trên mạng), nhưng còn cái biên độ của nó thì mình ko biết phải làm sao?, ở đây mảng arrSpectrogram là phổ theo biên độ.
hix mong mọi người giúp mình,
Comment