dsp.zip

  • teamzone
    了解作者
  • matlab
    开发工具
  • 26.5MB
    文件大小
  • zip
    文件格式
  • 0
    收藏次数
  • 10 积分
    下载积分
  • 1
    下载次数
  • 2020-07-15 10:17
    上传日期
一种适用于MATLAB的算法例程(关于dsp算法的相关内容)
dsp.zip
  • dsp
  • main
  • MeasurePinkNoisePowerInOctaveBandsExample.m
    2.1KB
  • MeasureFrequencyResponseCharacteristicsOfLowpassFilterExample.mlx
    2.5KB
  • DisableTheCorrectionStepInTheKalmanFilterExample.m
    1.6KB
  • UpsampleAndInterpolateWithIIRHalfbandInterpolatorExample.mlx
    2.8KB
  • StateLevelsOf23VUnderdampedNoisyClockExample.mlx
    2.7KB
  • FilterDesignUsingFirceqripExample.m
    1.3KB
  • AutocorrelationOfANoisySineWaveExample.mlx
    3KB
  • UsingSpectrumEstimatorSystemObjectExample.m
    3.7KB
  • CoefficientsOfAnFIRHalfbandInterpolatorExample.m
    291B
  • HDLCodeGenerationFromHDLFIRRateConverterExample.m
    2.1KB
  • GetSpectralMaskStatusExample.mlx
    3.3KB
  • SysIdentOfAnFIRFilterUsingAdaptiveLatticeFilterExample.mlx
    2.9KB
  • UseHDLFIRFilterSystemObjectWithDefaultSettingsExample.mlx
    2.6KB
  • ComputeTheMinimumExample.m
    862B
  • SpectralMaskExample.m
    968B
  • DecreaseUnderrunSimulinkExample.m
    1.2KB
  • GenerateCodeToFilterUsingCascadeExample.m
    764B
  • DesignAMultistageInterpolatorExample.m
    654B
  • ButterworthBandpassFilterExample.m
    290B
  • DetermineVectorQuantizerCodewordExample.mlx
    2.7KB
  • MeasurePulseTransCharacOfStreamSigsExample.mlx
    4.7KB
  • ImpulseAndFrequencyResponseOfFIRLowpassFilterExample.m
    2KB
  • DisplayInputSignalofChangingSizeExample.m
    892B
  • EquirippleFIRPassbandFilterExample.m
    650B
  • GroupDelayOfADiscreteTimeMultirateFilterExample.m
    201B
  • AutocorrelationForPositiveLagsExample.mlx
    2.6KB
  • ResetAnFIRFilterExample.m
    561B
  • QPSKAdaptiveEqualizationWithFIRFilterExample.mlx
    3.2KB
  • ComputeTheHistogramOfRealAndComplexDataExample.m
    3.4KB
  • RealizeSimulinkModelOfALowpassButterworthFilterExample.m
    1.2KB
  • TransformLowpassFilterToComplexBandpassFilterExample.m
    502B
  • TwoEqualizersCenteredAtDifferentFrequenciesExample.m
    952B
  • CreateaComplextoMagnitudeandAngleblockforanHDLdesignExample.m
    2.2KB
  • ConvertLPCToAutocorrelationCoefficientsExample.mlx
    2.7KB
  • SynthesizeAndChannelizeAudioExample.m
    1.8KB
  • FrequencyResponseOfChannelizerExample.mlx
    3.5KB
  • CreateHalfbandFiltersUsingFdesignObjectExample.mlx
    3.2KB
  • PeaktoPeakValueOfMatrixInputExample.mlx
    2.6KB
  • ImplementFIRDecimatorInSimulinkExample.m
    1.4KB
  • BandEdgeFrequencieChannelizerExample.mlx
    2.9KB
  • FilterWhiteGaussianNoiseWithAnIIRHighpassFilterExample.m
    1.5KB
  • QPSKAdaptiveEqualizationUsingAdaptiveLatticeFilterExample.mlx
    3.1KB
  • NormalizeAMatrixExample.mlx
    2.6KB
  • ConvertFMSignalIntoAMSignalExample.m
    866B
  • ResetAHighpassFilterExample.m
    531B
  • FilterInputIntoLowpassAndHighpassSubbandsExample.mlx
    2.7KB
  • TransitionPostshootAndSettlingInfoOfA23VStepWaveformExample.m
    1.3KB
  • DesignABandpassFilterExample.m
    237B
  • DesignANyquistFilterUsingFirnyquistExample.m
    444B
  • ToleranceCostInSampleConversionExample.m
    1.2KB
  • DesignOfTheAllpassMappingFilterExample.mlx
    2.8KB
  • InterpolateASignalUsingCICInterpolatorObjectExample.mlx
    2.9KB
  • ResetAnIIRHalfbandDecimatorExample.m
    826B
  • ButterworthFilterDesignOptionsExample.m
    511B
  • ConvertLPCToLSPCoefficientsExample.mlx
    2.6KB
  • ButterworthBandstopFilterExample.m
    426B
  • NormalizeTheCoefficientsOfADirectFormIIFilterExample.mlx
    2.7KB
  • DesignAnIIRFilterExample.m
    400B
  • TimeScopeViewSineWaveInputSignalsExample.m
    1KB
  • DesignOfLowpassFilterExample.m
    1.3KB
  • BandstopFilteringOfSinusoidsExample.mlx
    2.8KB
  • LinearAndNonlinearPhaseExample.m
    1.4KB
  • DCBlockerwithFixedPointDataExample.m
    1.9KB
  • PlotUnwrappedPhaseOfASineWaveExample.m
    1.1KB
  • ComputeTheRunningMinimumExample.m
    1002B
  • DesignAnAllpassFilterWithAnArbitraryGroupDelayExample.m
    339B
  • RemoveHighFrequencyNoiseFromGyroscopeDataExample.m
    1.4KB
  • FilteringThroughAVariableBandwidthBandpassFIRFilterExample.m
    1.4KB
  • DesignLowpassFilterExample.m
    627B
  • ValidStructuresForButterworthFilterExample.m
    460B
  • FilterSignalUsingTheFilterFunctionExample.mlx
    3.1KB
  • ComputeTheMovingRMSOfANoisyRampSignalExample.m
    1.3KB
  • ConvertCoupledAllpassToTransferFunctionFormExample.m
    549B
  • TransformLowpassFilterToComplexBandstopFilterExample.m
    508B
  • CompareSingleRateStageFiltersWithMultiratestageFiltersExample.m
    3.7KB
  • DesignFIRInterpolatorExample.m
    635B
  • LowpassFilterDesignExample.m
    8.3KB
  • UpconvertAndDownconvertASineWaveSignalExample.m
    2.2KB
  • DesignALowpassAndAWidebandHighpassFilterExample.m
    346B
  • CloneDefaultSampleRateConverterExample.mlx
    2.6KB
  • ChangeTheEndiannessOfTheDataExample.mlx
    2.8KB
  • CompensationInterpolatorDesignExample.m
    1.6KB
  • CoefficientsOfChannelizerExample.mlx
    2.9KB
  • FFTandIFFTofSinusoidExample.mlx
    6.7KB
  • FrequencyDomainFilteringUsingOverlapaddAndOverlapSaveExample.m
    2KB
  • EstimateAChangingScalarExample.m
    1.2KB
  • FindIndicesOfNearestCodewordsExample.mlx
    2.8KB
  • MagnitudeResponseOfConstrainedOptimalIIRFilterExample.m
    453B
  • DefaultResamplingFactorsFarrowExample.mlx
    2.5KB
  • DesignACICCompensatorUsingFdesignObjectExample.m
    876B
  • WidthPeriodAndDutyCycleExample.mlx
    2.9KB
  • BlockLMSAdaptiveAlgorithmExample.mlx
    2.7KB
  • MinimizingLowpassFIRFilterLengthExample.m
    2.4KB
  • ReadTheHeaderDataExample.mlx
    2.9KB
  • ConstructANyquistFilterUsingFdesignObjectExample.mlx
    3.2KB
  • PeaktoPeakValueOfVectorExample.mlx
    2.6KB
  • TwoChannelFilterBankExample.m
    2.1KB
  • StopbandConstraintsExample.m
    838B
内容介绍
%% Design of Decimators/Interpolators % This example shows how to design filters for decimation and % interpolation. Typically lowpass filters are used for decimation and for % interpolation. When decimating, lowpass filters are used to reduce the % bandwidth of a signal prior to reducing the sampling rate. This is done % to minimize aliasing due to the reduction in the sampling rate. When % interpolating, lowpass filters are used to remove spectral images from % the low-rate signal. For general notes on lowpass filter design see the % example on <matlab:web([docroot,'dsp/examples/designing-low-pass-fir-filters.html']); % Designing Low Pass FIR Filters>. % Copyright 1999-2014 The MathWorks, Inc. %% Input signal % Before we begin, let us define the signal that we will be throughout the % example. The samples of the signal we will be using are drawn from % standard normal distribution to have a flat spectrum. HSource = dsp.SignalSource('SamplesPerFrame', 500); HSource.Signal = randn(1e6,1); % Gaussian white noise signal %% Design of Decimators % When decimating, the bandwidth of a signal is reduced to an appropriate % value so that minimal aliasing occurs when reducing the sampling rate. % Suppose a signal that occupies the full Nyquist interval (i.e. has been % critically sampled) has a sampling rate of 800 Hz. The signal's energy % extends up to 400 Hz. If we'd like to reduce the sampling rate by a % factor of 4 to 200 Hz, significant aliasing will occur unless the % bandwidth of the signal is also reduced by a factor of 4. Ideally, a % perfect lowpass filter with a cutoff at 100 Hz would be used. In % practice, several things will occur: The signal's components between 0 % and 100 Hz will be slightly distorted by the passband ripple of a % non-ideal lowpass filter; there will be some aliasing due to the finite % stopband attenuation of the filter; the filter will have a transition % band which will distort the signal in such band. The amount of distortion % introduced by each of these effects can be controlled by designing an % appropriate filter. In general, to obtain a better filter, a higher % filter order will be required. %% % Let's start by designing a simple lowpass decimator with a decimation % factor of 4. M = 4; % Decimation factor Fp = 80; % Passband-edge frequency Fst = 100; % Stopband-edge frequency Ap = 0.1; % Passband peak-to-peak ripple Ast = 80; % Minimum stopband attenuation Fs = 800; % Sampling frequency HfdDecim = fdesign.decimator(M,'lowpass',Fp,Fst,Ap,Ast,Fs) %% % The specifications for the filter determine that a transition band of 20 % Hz is acceptable between 80 and 100 Hz and that the minimum attenuation % for out of band components is 80 dB. Also that the maximum distortion for % the components of interest is 0.05 dB (half the peak-to-peak passband % ripple). An equiripple filter that meets these specs can be easily % obtained as follows: HDecim = design(HfdDecim,'equiripple', 'SystemObject', true); measure(HDecim) HSpec = dsp.SpectrumAnalyzer(... % Spectrum scope 'PlotAsTwoSidedSpectrum', false, ... 'SpectralAverages', 50, 'OverlapPercent', 50, ... 'Title', 'Decimator with equiripple lowpass filter',... 'YLimits', [-50, 0], 'SampleRate', Fs/M*2); while ~isDone(HSource) inputSig = HSource(); % Input decimatedSig = HDecim(inputSig); % Decimator HSpec(upsample(decimatedSig,2)); % Spectrum % The upsampling is done to increase X-limits of SpectrumAnalyzer % beyond (1/M)*Fs/2 for better visualization end release(HSpec); reset(HSource); %% % It is clear from the measurements that the design meets the specs. %% Using Nyquist Filters % Nyquist filters are attractive for decimation and interpolation due to % the fact that a 1/M fraction of the number of coefficients is zero. The % band of the Nyquist filter is typically set to be equal to the decimation % factor, this centers the cutoff frequency at (1/M)*Fs/2. In this example, % the transition band is centered around (1/4)*400 = 100 Hz. TW = 20; % Transition width of 20 Hz HfdNyqDecim = fdesign.decimator(M,'nyquist',M,TW,Ast,Fs) %% % A Kaiser window design can be obtained in a straightforward manner. HNyqDecim = design(HfdNyqDecim,'kaiserwin','SystemObject', true); HSpec2 = dsp.SpectrumAnalyzer('PlotAsTwoSidedSpectrum', false, ... 'SpectralAverages', 50, 'OverlapPercent', 50, ... 'Title', 'Decimator with Nyquist filter',... 'YLimits', [-50, 0],... 'SampleRate', Fs/M*2); % Spectrum scope while ~isDone(HSource) inputSig = HSource(); % Input decimatedSig = HNyqDecim(inputSig); % Decimator HSpec2(upsample(decimatedSig,2)); % Spectrum % The upsampling is done to increase X-limits of SpectrumAnalyzer % beyond (1/M)*Fs/2 for better visualization end release(HSpec2); reset(HSource); %% Aliasing with Nyquist Filters % Suppose the signal to be filtered has a flat spectrum. Once filtered, it % acquires the spectral shape of the filter. After reducing the sampling % rate, this spectrum is repeated with replicas centered around multiples % of the new lower sampling frequency. An illustration of the spectrum of % the decimated signal can be found from: NFFT = 4096; [H,f] = freqz(HNyqDecim,NFFT,'whole',Fs); figure; plot(f-Fs/2,20*log10(abs(fftshift(H)))) grid on hold on plot(f-Fs/M,20*log10(abs(fftshift(H))),'r-') plot(f-Fs/2-Fs/M,20*log10(abs(fftshift(H))),'k-') legend('Baseband spectrum', ... 'First positive replica', 'First negative replica') title('Alisasing with Nyquist filter'); fig = gcf; fig.Color = 'White'; hold off %% % Note that the replicas overlap somewhat, so aliasing is introduced. % However, the aliasing only occurs in the transition band. That is, % significant energy (above the prescribed 80 dB) from the first replica % only aliases into the baseband between 90 and 100 Hz. Since the filter % was transitioning in this region anyway, the signal has been distorted in % that band and aliasing there is not important. %% % On the other hand, notice that although we have used the same transition % width as with the lowpass design from above, we actually retain a wider % usable band (90 Hz rather than 80) when comparing this Nyquist design % with the original lowpass design. To illustrate this, let's follow the % same procedure to plot the spectrum of the decimated signal when % the lowpass design from above is used [H,f] = freqz(HDecim,NFFT,'whole',Fs); figure; plot(f-Fs/2,20*log10(abs(fftshift(H)))) grid on hold on plot(f-Fs/M,20*log10(abs(fftshift(H))),'r-') plot(f-Fs/2-Fs/M,20*log10(abs(fftshift(H))),'k-') legend('Baseband spectrum', ... 'First positive replica', 'First negative replica') title('Alisasing with lowpass filter'); fig = gcf; fig.Color = 'White'; hold off %% % In this case, there is no significant overlap (above 80 dB) between % replicas, however because the transition region started at 80 Hz, the % resulting decimated signal has a smaller usable bandwidth. %% Decimating by 2: Halfband Filters % When the decimation factor is 2, the Nyquist filter becomes a halfband % filter. These filters are very attractive because just about half of % their coefficients are equal to zero. Often, to design Nyquist filters % when the band is an even number, it is desirable to perform a multistage % design that uses halfband filters in some/all of the stages. HfdHBDecim = fdesign.decimator(2,'halfband'); HHBDecim = design(HfdHBDecim,'equiripple','SystemObject', true); HSpec3 = dsp.SpectrumAnalyzer('PlotAsTwoSidedSpectrum', false, ... 'SpectralAverages', 50, 'OverlapPercent', 50, ... 'Title', 'Decimator with halfband filter',... 'YLimits', [-50, 0],... 'SampleRate',
评论
    相关推荐
    • DSP matlab.rar
      dsp small programs and its descriptions
    • DSP MATLAB仿真.zip
      关于各种数字信号处理滤波器的matlab仿真
    • DSP分配:DSP-matlab开发
      (1)DFT估计的频谱需要绘制相应的波形。 (2)当L=1024时,计算线性卷积和快速卷积所需的时间,并与两个序列通过重叠加法的线性卷积进行比较。 (3)判断是否可以用补零法区分两个谱峰; 如果不是,应该采用什么方法...
    • matlab用于dsp
      dsp实验% Program P4_3 % Zero Locations of Linear Phase FIR Filters clf; b = [1 -8.5 30.5 -63]; num1 = [b 81 fliplr(b)]; num2 = [b 81 81 fliplr(b)]; num3 = [b 0 -fliplr(b)]; num4 = [b 81 -81 -fliplr(b)...
    • 基于dspmatlab实例
      内有关于设置滤波器、计算fft等的基于dspmatlab编程实例
    • dsp using matlab 中文
      还附有Digital Signal Processing Using Matlab 例程
    • matlab dsp 实现的DDS
      matlab dsp 实现的DDSmatlab dsp 实现的DDSmatlab dsp 实现的DDS
    • DSP_matlab
      matlab实现DSP数字信号处理功能,注重基础,是入门学习的好资料!
    • 基于matlabDSP实验
      几个基于matlabDSP实验,附有源程序及实验波形: 常见离散信号的MATLAB产生和图形显示 离散系统的差分方程、冲激响应和卷积分析 离散系统的频率响应分析和零、极点分布 离散信号的DTFT和DFT 基于MATLAB的数字...
    • DSP_MATLAB
      本光盘共包含三个子目录,分别是DSP_FORTRAN, DSP_C和DSP_MATLABDSP_FORTRAN和DSP_C各含有约40个信号处理的子程序,概括了书中所涉及到的绝大部分算法。程序分别由FORTRAN语言和C语言编写(MA模型、ARMA模型及最小...