design a filter without any toolboxes
조회 수: 2 (최근 30일)
이전 댓글 표시
i want to design a filter without use any toolboxes. I have some question about it: If i would like to add to the filter, that for example pass between 123 - 456 Hz with -2.35 dB attenuation, and the other parts shall be maximum damping, what should i do? Where do i find out, that how much attenuation i get on the other parts? Where do i specify the filter vector? Where they appear in the logic design of the filter types and where to bring the decision whether to use XY type of filter design? I need some help about this.
i made a random characteristics filter like this:
clear; clc;
%% %read the original wav file [fname,dirpath]=uigetfile('*.wav'); [Wsize,Fs,Bits]=wavread([dirpath,fname],'size'); [y, Fs]=wavread([dirpath,fname]); %FS sample rate sound(y, Fs); %% %%analyze the signal
T = 1/Fs; % Sample time L = numel(y); % Length of signal NFFT = 2^nextpow2(L); % Next power of 2 from length of y Y = fft(y); % calculate the original signals fft f = Fs/2*linspace(0,1,NFFT/2+1); %The all frequencies
%% %filter the DFT signal with random numbers
%generate random numbers for predefined amplitude characterics rands = flipdim(rand(1,L)',1);
% the randoms are from 0hz to 'f' hz Y_w1 = (Y.*rands);
% plot the original and the weight DFT signals hold all
%filtered signal plot(f, abs(2*(Y_w1(1:NFFT/2+1)))); %original signal plot(f, abs(2*(Y(1:NFFT/2+1)))); title('Amplitude Spectrum of y(t)') xlabel('Frequency (Hz)')
y_w = (real(ifft(Y_w1)));
sound(y_w, Fs);
댓글 수: 0
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Digital Filter Analysis에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!