{"id":7750,"date":"2024-07-07T19:01:01","date_gmt":"2024-07-07T11:01:01","guid":{"rendered":""},"modified":"2024-07-07T19:01:01","modified_gmt":"2024-07-07T11:01:01","slug":"\u6570\u5b57\u4fe1\u53f7\u5904\u7406\u6ee4\u6ce2\u5668\u56db\u4e2a\u65b9\u6cd5_fir\u6ee4\u6ce2\u5668\u539f\u7406","status":"publish","type":"post","link":"https:\/\/mushiming.com\/7750.html","title":{"rendered":"\u6570\u5b57\u4fe1\u53f7\u5904\u7406\u6ee4\u6ce2\u5668\u56db\u4e2a\u65b9\u6cd5_fir\u6ee4\u6ce2\u5668\u539f\u7406"},"content":{"rendered":"
@\u6570\u5b57\u4fe1\u53f7\u5904\u7406\u5927\u4f5c\u4e1a\u2014\u2014\u57fa\u4e8ematlab R2019a\u7684\u7537\u58f0\u53d8\u5973\u58f0\u8d44\u6599\u6c47\u603b\u4e0e\u4ee3\u7801<\/p>\n
\u6982\u8ff0<\/p>\n
\u53c2\u8003\u4e86\u5f88\u591a\u524d\u4eba\u7684\u8d44\u6599\uff0c\u53d1\u73b0\u5f88\u591a\u51fd\u6570\u5df2\u7ecf\u8fc7\u65f6\u4e86\uff0c\u800c\u4e14\u4ece\u6211\u901a\u8fc7VIP\u4e0b\u8f7d\u7684\u4ee3\u7801\u6765\u770b\uff0c\u4ee3\u7801\u7684\u903b\u8f91\u4e0d\u662f\u5f88\u6e05\u6670\uff0c\u5e9f\u8bdd\u4e5f\u591a\uff0c\u6ce8\u91ca\u4e5f\u5199\u7684\u4e0d\u6e05\u695a(\u4e5f\u53ef\u80fd\u4e5f\u662f\u6211\u592a\u5c0f\u767d\u4e86\u770b\u4e0d\u61c2\u54c8\u54c8\u54c8\u54c8\u54c8)\u5199\u535a\u5ba2\u7684\u521d\u5fc3\u662f\u5bf9\u81ea\u5df1\u8fd9\u4e09\u5929\u505a\u7684\u5de5\u4f5c\u7ed9\u4e2a\u603b\u7ed3\uff0c\u65b9\u4fbf\u4ee5\u540e\u7684\u4eba\uff0c\u81ea\u5df1\u4e5f\u611f\u89c9\u975e\u5e38\u5f00\u5fc3\uff0c\u563f\u563f\uff01<\/p>\n
\u770b\u770b\u6211\u7684\u6587\u4ef6\u5939<\/p>\n
\u5404\u4f4d\u5c0f\u767d\u83dc\u6ce8\u610f\uff0cmatlab\u7684\u4ee3\u7801\u548c\u5176\u4ed6\u76f8\u5173\u6587\u4ef6\u4e00\u5b9a\u8981\u6574\u6574\u9f50\u9f50\u7684\u653e\u597d\uff0c\u5426\u5219\u4ee5\u540e\u6709\u4f60\u7684\u82e6\u5403\uff0c\u563f\u563f\u563f\uff1b\u6211\u4e5f\u662f\u5c0f\u767d\u563f\u563f\uff0c\u5927\u5bb6\u8981\u4e92\u76f8\u5b66\u4e60\u9e2d\uff1b\u7b2c\u4e00\u6b21\u5199\u535a\u5ba2\uff0c\u6392\u7248\u4e11\u5e0c\u671b\u591a\u63d0\u5efa\u8bae\uff0c\u5c0f\u6731\u7ed9\u5927\u5bb6\u97a0\u8eac\uff01<\/p>\n
<\/p>\n
<\/p>\n
<\/p>\n
<\/p>\n
\u7b97\u6cd5\u539f\u7406<\/p>\n
\u67e5\u5230\u4e86\u51e0\u79cd\uff0c\u4ee5\u4e0b\u4e3a\u5c0f\u672c\u672c\u8bb0\u5f55\u7684\uff1a<\/p>\n
\u5bf9\u8bed\u97f3\u7684\u91c7\u6837\u7387\u8fdb\u884c\u53d8\u5316\uff0c\u5c31\u80fd\u6539\u53d8\u58f0\u97f3\u3002\u6bd4\u5982\u91c7\u6837\u7387\u4f4e\u4e8e\u5948\u594e\u65af\u7279\u5b9a\u7406\u4e2d\u76842fh,\u5c31\u4f1a\u4e22\u5931\u9ad8\u9891\u5206\u91cf\uff0c\u58f0\u97f3\u97f3\u8272\u81ea\u7136\u4f1a\u53d8\u5316\u3002\u4f46\u662f\u8fd9\u79cd\u4f1a\u4e22\u5931\u4fe1\u606f\uff0c\u800c\u4e14\u4e0d\u6613\u7528\u53c2\u6570\u63a7\u5236\uff1b<\/p>\n
\u53ef\u4ee5\u901a\u8fc7\u6539\u53d8\u64ad\u653e\u7684\u901f\u5ea6\u5b9e\u73b0,\u5feb5%\u5c31\u662f\u5973\u58f0,\u61625%\u5c31\u662f\u7537\u58f0\u3002\u8bb0\u5f97\u591a\u666e\u52d2\u6548\u5e94\u5417\uff1f\u4e00\u8f86\u54cd\u7740\u6c7d\u7b1b\u58f0\u7684\u8f66\uff0c\u671d\u4f60\u6765\u65f6\u58f0\u97f3\u5c16\uff0c\u79bb\u4f60\u8fdc\u53bb\u65f6\u58f0\u97f3\u95f7\uff0c\u5927\u6982\u6709\u70b9\u8fd9\u610f\u601d\u3002\u4f46\u662f\u663e\u7136\uff0c\u6211\u4eec\u4e0d\u5e0c\u671b\u8f93\u5165\u8f93\u51fa\u7684\u58f0\u97f3\u901f\u5ea6\u53d1\u751f\u53d8\u5316\uff0c\u8fd9\u6837\u7528\u6237\u4f53\u9a8c\u4e5f\u592a\u5dee\u4e86\uff1b<\/p>\n
\u6240\u4ee5\u7537\u5973\u58f0\u53d8\u8c03\u5fc5\u987b\u662f\u8fdb\u884c\u9891\u8c31\u642c\u79fb\u3002\u5b66\u8fc7\u901a\u7535\/\u4fe1\u53f7\u4e0e\u7cfb\u7edf\u7684\u540c\u5fd7\u4eec\u90fd\u77e5\u9053\uff0c\u4f59\u5f26\u51fd\u6570\u4e58\u4e2a\u4f59\u5f26\u51fd\u6570\uff0c\u79ef\u5316\u548c\u5dee\uff0c\u4f1a\u6709\u548c\u9891\u5dee\u9891\u5206\u91cf\u751f\u6210\uff0c\u9891\u8c31\u53d1\u751f\u4e86\u642c\u79fb\uff0c\u8fd9\u79cd\u53d8\u5316\u79f0\u4e3a\u201c\u8c03\u5236\u201d\u3002\u6240\u4ee5\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u8fd9\u79cd\u65b9\u6cd5\u5b9e\u73b0\u5417\uff1f\u4e0d\u884c\u3002\u901a\u7535\u91cc\u53ef\u4ee5\uff0c\u662f\u56e0\u4e3a\u4e24\u4e2a\u76f8\u4e58\u91cf\u7684\u9891\u7387\u5927\u5c0f\u76f8\u5dee\u751a\u8fdc\uff0c\u751f\u6210\u7684\u4fe1\u53f7\u53ef\u4ee5\u65b9\u4fbf\u7684\u6ee4\u51fa\u6765\u3002\u7537\u58f0\u5973\u58f0\u8ddd\u79bb\u5f88\u8fd1\uff0c\u9891\u5e26\u53c8\u5bbd\uff0c\u6240\u4ee5\u7528\u6a21\u62df\u7684\u65b9\u6cd5\u6ca1\u6cd5\u5b9e\u73b0\u3002<\/p>\n
\u54c8\u54c8\u54c8\u6240\u4ee5\u8fd9\u65f6\u5019\u5c31\u4f53\u73b0\u4e86\u6570\u5b57\u4fe1\u53f7\u5904\u7406\u7684\u4f18\u8d8a\u6027\uff0c\u867d\u7136\u76ee\u524d\u6211\u505a\u7684\u6548\u679c\u4e5f\u4e0d\u5927\u597d\uff0c\u4f46\u6211\u76f8\u4fe1\u6211\u80fd\u505a\u7684\u66f4\u597d\uff0c\u4e4b\u540e\u4f1a\u66f4\u65b0\u7684\uff01\u6709\u4e9b\u4ee3\u7801\u7528cirshift\u8fdb\u884c\u642c\u79fb\uff0c\u53ef\u5b83\u5c31\u662f\u4e2a\u8ba9\u9891\u8c31\u5728\u56fa\u5b9a\u8303\u56f4\u8f6c\u5708\u7684\u51fd\u6570\uff0c\u6211\u771f\u4e0d\u660e\u767d\u7528\u5b83\u6709\u4f55\u7528\u3002\u6240\u4ee5\u6211\u6700\u540e\u9009\u62e9\u65f6\u57df\u4e58exp(jwt),\u53ef\u6548\u679c\u4e5f\u4e0d\u597d\uff0c\u6211\u4e0d\u660e\u767d\u4e3a\u5565\u3002\u8fd9\u5927\u6982\u5c31\u662f\u7406\u60f3\u4e0e\u73b0\u5b9e\u7684\u5dee\u8ddd\uff0c\u8bf4\u660e\u7406\u8bba\u843d\u5730\u5f88\u96be\u3002<\/p>\n
try1.m<\/p>\n
clc<\/p>\n
[y1,Fs] = audioread('source.wav'); %\u8bfb\u51fa\u4fe1\u53f7\uff0c\u91c7\u6837\u7387\u548c\u91c7\u6837\u4f4d\u6570\u3002 %\u6ce8\u610f\u6587\u4ef6\u683c\u5f0f\u8981\u6c42<\/p>\n
%source\u4e3a\u7537\u58f0\u97f3\u9891<\/p>\n
%sound(y1,Fs); %\u64ad\u653e\u6587\u4ef6<\/p>\n
%\u8bbe\u8ba1\u5df4\u7279\u6c83\u65af\u4f4e\u901a\u6ee4\u6ce2\u5668 \u6b64\u5904\u52a0\u6ee4\u6ce2\u5668\u4f1a\u4f7f\u58f0\u97f3\u53d8\u6a21\u7cca\uff0c\u4f3c\u4e4e\u5f88\u91cd\u8981\u7684\u9ad8\u9891\u5206\u91cf\u88ab\u4e22\u6389\u4e86<\/p>\n
%Wc1=2*1000\/Fs; %\u7537\u58f0\u622a\u6b62\u9891\u7387 1000Hz<\/p>\n
%[b,a]=butter(4,Wc1);<\/p>\n
%y1=filter(b,a,y1);<\/p>\n
Y1 = fft(y1);%Fast Fourier transform<\/p>\n
sigLength=length(y1);%Length of largest array dimension<\/p>\n
f=Fs*(1:sigLength)\/sigLength;<\/p>\n
absY=abs(Y1);%Absolute value and complex magnitude<\/p>\n
figure('Name','Measured Data','NumberTitle','off');<\/p>\n
%Create figure window<\/p>\n
%Specify the Name property again, but this time, set the NumberTitle property to 'off'.<\/p>\n
%The resulting title does not include the figure number.<\/p>\n
%\u7ed8\u5236\u7537\u58f0\u9891\u57df<\/p>\n
subplot(2,2,1);plot(f,absY);xlabel('Frequency(Hz)\u7537\u58f0\u9891\u57df');grid on<\/p>\n
%\u7ed8\u5236\u7537\u58f0\u65f6\u57df<\/p>\n
t=(0:sigLength-1)\/Fs;%t = 1 \/ f<\/p>\n
subplot(2,2,2);plot(t,y1);xlabel('Time(s)\u7537\u58f0\u65f6\u57df');grid on<\/p>\n
%\u9891\u8c31\u642c\u79fb(\u65f6\u57df\u76f8\u79fb\uff0c\u9891\u57df\u8c03\u5236)<\/p>\n
Y2 = fft(y1 .* exp(1000\/(2 * pi) * 1i .* t'));<\/p>\n
%\u7ed8\u5236\u5973\u58f0\u9891\u57df<\/p>\n
absY2=abs(Y2);<\/p>\n
subplot(2,2,3);plot(f,absY2);xlabel('Frequency(Hz)\u5973\u58f0\u9891\u57df');grid on<\/p>\n
%\u7ed8\u5236\u5973\u58f0\u65f6\u57df<\/p>\n
y2=ifft(Y2);<\/p>\n
subplot(2,2,4);plot(t,y2);xlabel('Time(s)\u5973\u58f0\u65f6\u57df');grid on<\/p>\n
y2=abs(y2);%audiowrite\u5fc5\u987b\u8f93\u5165\u4e3a\u5b9e\u6570<\/p>\n
%\u5931\u8d25\u7684\u6ee4\u6ce2\u5668\u5c1d\u8bd5<\/p>\n
%BPF = load('LPF_60M.mat');<\/p>\n
%y3 = filter(BPF.LPF_60M,1,y2);<\/p>\n
%\u80fd\u8c03\u901a\u4f46\u662f\u6548\u679c\u4e0d\u597d\u7684\u6ee4\u6ce2\u5668\u5c1d\u8bd5<\/p>\n
y3=highp(y2,400,500,0.0001,0.02,Fs);<\/p>\n
audiowrite('transform30.wav',y3,Fs)<\/p>\n
%transform30\u4e3a\u751f\u6210\u7684\u6587\u4ef6\uff0c\u5b83\u751f\u6210\u7684\u5730\u5740\u4e0d\u662f\u5f88\u786e\u5b9a\uff0c\u4f1a\u53d1\u751f\u53d8\u5316\uff0c<\/p>\n
%\u6211\u8fd8\u6ca1\u641e\u660e\u767d\uff0c\u4ee5\u4e0b\u662f\u5b83\u51fa\u73b0\u7684\u4e24\u4e2a\u4f4d\u7f6e\uff1a<\/p>\n
%C:\\Users\\honor\\Documents\\MATLAB\\Examples\\R2019a\\matlab\\WriteanAudioFileExample<\/p>\n
%E:\\\u2026\\dsp_greatassignment\\try<\/p>\n
\u82e5\u4e0d\u6e05\u695a\u53ef\u5728\u7535\u8111\u201c\u5f00\u59cb\u201d\u91cc\u641c\u4e00\u4e0b\u5177\u4f53\u5728\u54ea\u3002<\/p>\n
\u4e0a\u9762\u7528\u5230\u7684highp\u51fd\u6570\uff0c\u8fd9\u6bb5\u4ee3\u7801\u5f88\u591a\u7f51\u9875\u4e0a\u90fd\u6709\uff0c\u6211\u662f\u4ecehttps:\/\/www.cnblogs.com\/tkppain\/p\/6691052.html?utm_source=itdadao&utm_medium=referral \u590d\u5236\u7c98\u8d34\u8fc7\u6765\u5e76\u4f5c\u4e86\u4e00\u4e9b\u6539\u52a8\u3002<\/p>\n
function y=highp(x,f1,f2,rp,rs,Fs)<\/p>\n
%\u9ad8\u901a\u6ee4\u6ce2,\u8be5\u4ee3\u7801\u9c81\u68d2\u6027\u5f88\u5dee\uff0c\u8bd5\u8bd5\u4f60\u5c31\u6653\u5f97\u4e86<\/p>\n
%\u4e5f\u53ef\u80fd\u662f\u6211\u4e0d\u4f1a\u7528<\/p>\n
%\u901a\u5e26\u6216\u963b\u5e26\u7684\u622a\u6b62\u9891\u7387\u7684\u9009\u53d6\u8303\u56f4\u662f\u4e0d\u80fd\u8d85\u8fc7\u91c7\u6837\u7387\u7684\u4e00\u534a<\/p>\n
%\u5373\uff0cf1,f3\u7684\u503c\u90fd\u8981\u5c0f\u4e8e Fs\/2<\/p>\n
%x:\u9700\u8981\u5e26\u901a\u6ee4\u6ce2\u7684\u5e8f\u5217<\/p>\n
% f 1\uff1a\u901a\u5e26\u622a\u6b62\u9891\u7387<\/p>\n
% f 2\uff1a\u963b\u5e26\u622a\u6b62\u9891\u7387<\/p>\n
%rp\uff1a\u8fb9\u5e26\u533a\u8870\u51cfDB\u6570\u8bbe\u7f6e<\/p>\n
%rs\uff1a\u622a\u6b62\u533a\u8870\u51cfDB\u6570\u8bbe\u7f6e<\/p>\n
%FS\uff1a\u5e8f\u5217x\u7684\u91c7\u6837\u9891\u7387<\/p>\n
wp=2*pi*f1\/Fs;<\/p>\n
ws=2*pi*f2\/Fs;<\/p>\n
% \u8bbe\u8ba1\u5207\u6bd4\u96ea\u592b\u6ee4\u6ce2\u5668\uff1b<\/p>\n
[n,wn]=cheb1ord(wp\/pi,ws\/pi,rp,rs);<\/p>\n
[bz1,az1]=cheby1(n,rp,wp\/pi,'high');<\/p>\n
%\u67e5\u770b\u8bbe\u8ba1\u6ee4\u6ce2\u5668\u7684\u66f2\u7ebf<\/p>\n
[h,w]=freqz(bz1,az1,256,Fs);<\/p>\n
h=20*log10(abs(h));<\/p>\n
figure('Name','highpass filter','NumberTitle','off');<\/p>\n
plot(w,h);title('\u6240\u8bbe\u8ba1\u6ee4\u6ce2\u5668\u7684\u901a\u5e26\u66f2\u7ebf');grid on;<\/p>\n
y=filter(bz1,az1,x);<\/p>\n
end<\/p>\n
%\u5931\u8d25\u7684\u6ee4\u6ce2\u5668\u5c1d\u8bd5 \u4f7f\u7528\u4e86\u901a\u8fc7VIP\u4e0b\u8f7d\u7684\u4ee3\u7801(\u5c31\u662f\u53c2\u8003\u4ee3\u7801\u91cc\u7684\u2018filter\u2019)\uff0c\u4f46\u662f\u4e0d\u77e5\u4e3a\u4f55\u8c03\u4e0d\u901a\u3002\u5728MATLAB\u547d\u4ee4\u884c\u7a97\u53e3\u952e\u5165fdatool\u5373\u53ef\u5f39\u51fa\u8bbe\u8ba1\u6ee4\u6ce2\u5668\u7684\u7a97\u53e3\uff0c\u4f46\u662f\u8bbe\u8ba1\u5b8c\u76f4\u63a5\u4fdd\u5b58\u540e\u751f\u6210\u7684\u662f.fda\u6587\u4ef6\uff0c\u6ca1\u6cd5\u76f4\u63a5\u7528\uff0c\u5f97\u53d8\u6210.mat\u6587\u4ef6\uff1b.mat\u6587\u4ef6\u4e5f\u6ca1\u6cd5\u76f4\u63a5\u7528\uff0c\u5f97\u5728\u7f16\u8f91\u5668\u4f7f\u7528\u201cload(\u2018BPF_130M.mat\u2019)\u201d\u6216\u8005\u5728\u6587\u4ef6\u5939\u53cc\u51fb\u5b83\u3002\u53ef\u662f\uff0c\u53ef\u80fd\u6211\u5bfc\u51fa\u4e3amat\u6587\u4ef6\u7684\u53c2\u6570\u6ca1\u9009\u5bf9\uff0c\u770b\u7740\u548c\u53c2\u8003\u4ee3\u7801\u2018filter\u2019\u4e00\u6837\uff0c\u5c31\u662f\u8c03\u4e0d\u901a\u3002\u6349\u6025~~<\/p>\n
\u8d44\u6599<\/p>\n
\u4ee5\u4e0b\u4e3a\u8270\u96be\u66f2\u6298\u63a2\u7d22\u8fc7\u7a0b\u4e2d\u8def\u8fc7\u7684\u6709\u5e2e\u52a9\u7684\u7f51\u9875\u3002<\/p>\n
https:\/\/jingyan.baidu.com\/article\/3052f5a108e14397f21f8658.html<\/p>\n
\u6253\u5f00.mat\u6587\u4ef6<\/p>\n
https:\/\/wenku.baidu.com\/view\/cf9f236cbd64783e09122b87.html#<\/p>\n
fdatool\u548cFIR MegaCore\u4f7f\u7528\u6280\u5de7\u7684\u95ee\u9898<\/p>\n
https:\/\/blog.csdn.net\/yangming2466\/article\/details\/<\/p>\n
\u4e03\u79cd\u6ee4\u6ce2\u65b9\u6cd5<\/p>\n
https:\/\/blog.csdn.net\/flypassion\/article\/details\/?ops_request_misc=%257B%2522request%255Fid%2522%253A%051089%2522%252C%2522scm%2522%253A%3.\u2026%2522%257D&request_id=89&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2allfirst_rank_v2~rank_v28-1-.first_rank_ecpm_v3_pc_rank_v2&utm_term=%E9%AB%98%E9%80%9A%E6%BB%A4%E6%B3%A2%E5%99%A8matlab&spm=1018.2118.3001.4187<\/p>\n
\u6ee4\u6ce2\u5668\u8d44\u6599<\/p>\n
https:\/\/www.cnblogs.com\/lianjiehere\/p\/3806964.html<\/p>\n
fda\u6587\u4ef6<\/p>\n
https:\/\/blog.csdn.net\/_\/article\/details\/<\/p>\n
filter<\/p>\n
https:\/\/www.cnblogs.com\/tkppain\/p\/6691052.html<\/p>\n
\u6ee4\u6ce2<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"\u6570\u5b57\u4fe1\u53f7\u5904\u7406\u6ee4\u6ce2\u5668\u56db\u4e2a\u65b9\u6cd5_fir\u6ee4\u6ce2\u5668\u539f\u7406@\u6570\u5b57\u4fe1\u53f7\u5904\u7406\u5927\u4f5c\u4e1a\u2014\u2014\u57fa\u4e8ematlabR2019a\u7684\u7537\u58f0\u53d8\u5973\u58f0\u8d44\u6599\u6c47\u603b\u4e0e\u4ee3\u7801\u6982\u8ff0\u53c2\u8003\u4e86\u5f88\u591a...","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"_links":{"self":[{"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/posts\/7750"}],"collection":[{"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/comments?post=7750"}],"version-history":[{"count":0,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/posts\/7750\/revisions"}],"wp:attachment":[{"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/media?parent=7750"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/categories?post=7750"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/tags?post=7750"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}