how can I solve this error?
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
??? Error using ==> minus Matrix dimensions must agree.
Error in ==> Full at 27 e=d-d1; My code is function x=Full(~,~,~) % sinusoid f=30; %frequency, N=20; %number of samples fs=100; %sampling frequency A=2; %amplitute n = 0:N-1; % numbering the samples x = A*sin(2*pi*f*n/fs); %primary h(3)=1; h(4)=-2.7083; h(5)=4.1861; h(6)=-3.0451; h(7)=0.73071; d=conv(h,x); %filter functin y(n) b=0.3; y = filter(b,1,x); %transfer function s(n) k=[1 0.96 0.4923]; l=[1 1.06 0.3352]; [s,w]=freqz(k,l,'whole',2000); %secondary d1=conv(s,y); %error e=d-d1; plot(e) Thank you very much.
0 commentaires
Réponses (1)
John BG
le 26 Avr 2016
Kuheli
b=0.3; a=1
means you are not really filtering, just attenuating by 0.3
where do you get the values
k=[1 0.96 0.4923];
l=[1 1.06 0.3352];
from?
the syntax of freqz is erroneous. Command freqz should have a filter object as input, not k and l.
What do you call 'whole' , and why value 2000?
you can create filter objects with the following:
dsp.AllpassFilter
dsp.AllpoleFilter
dsp.BiquadFilter
dsp.CICCompensationDecimator
dsp.CICCompensationInterpolator
dsp.CICDecimator
dsp.CICInterpolator
dsp.CoupledAllpassFilter
dsp.FarrowRateConverter
dsp.FilterCascade
dsp.FIRDecimator
dsp.FIRFilter
dsp.FIRHalfbandDecimator
dsp.FIRHalfbandInterpolator
dsp.FIRInterpolator
dsp.FIRRateConverter
dsp.HighpassFilter
dsp.IIRFilter
dsp.IIRHalfbandDecimator
dsp.IIRHalfbandInterpolator
dsp.LowpassFilter
dsp.NotchPeakFilter
dsp.VariableBandwidthFIRFilter
dsp.VariableBandwidthIIRFilter
dsp.SampleRateConverter
and the error left behind, when attempting to : e=d-d1
d has 26 real values while d1 has 2019 complex values.
If you find this answer of any help solving your question,
please click on the thumbs-up vote link,
thanks in advance
John
0 commentaires
Voir également
Catégories
En savoir plus sur Fixed-Point Filters dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!