You are here : matlab → Signal Processing → sfdr
# sfdr() - Signal Processing

### Syntax

### Example

### Output / Return Value

### Limitations

### Alternatives / See Also

### Reference

exampler = sfdr(x) returns the spurious free dynamic range (SFDR), r, in dB of the real sinusoidal signal, x. sfdr computes the power spectrum using a modified periodogram and a Kaiser window with β = 38. The mean is subtracted from x before computing the power spectrum. The number of points used in the computation of the discrete Fourier transform (DFT) is the same as the length of the signal, x. r = sfdr(x,fs) returns the SFDR of the time-domain input signal, x, when the sampling rate, fs, is specified. The default value of fs is 1 Hz. exampler = sfdr(x,fs,msd) returns the SFDR considering only spurs that are separated from the fundamental (carrier) frequency by the minimum spur distance, msd, specified in cycles/unit time. The sampling frequency is fs. If the carrier frequency is Fc, then all spurs in the interval (Fc-msd, Fc+msd) are ignored. exampler = sfdr(sxx,f,pwrflag) returns the SFDR of the one-sided power spectrum of a real-valued signal, sxx. f is the vector of frequencies corresponding to the power estimates in sxx. The first element of f must equal 0. The algorithm removes all the power that decreases monotonically away from the DC bin. r = sfdr(sxx,f,msd,pwrflag) returns the SFDR considering only spurs that are separated from the fundamental (carrier) frequency by the minimum spur distance, msd. If the carrier frequency is Fc, then all spurs in the interval (Fc-msd, Fc+msd) are ignored. When the input to sfdr is a power spectrum, specifying msd can prevent high sidelobe levels from being identified as spurs. example[r,spurpow,spurfreq] = sfdr(___) returns the power and frequency of the largest spur. examplesfdr(___) with no output arguments plots the spectrum of the signal in the current figure window. It uses different colors to draw the fundamental component, the DC value, and the rest of the spectrum. It shades the SFDR and displays its value above the plot. It also labels the fundamental and the largest spur.

r = sfdr(x) exampler = sfdr(x,fs)r = sfdr(x,fs,msd) exampler = sfdr(sxx,f,pwrflag) exampler = sfdr(sxx,f,msd,pwrflag)[r,spurpow,spurfreq] = sfdr(___) examplesfdr(___) example

SFDR of SinusoidOpen This ExampleObtain the SFDR for a 10 MHz tone with amplitude 1 sampled at 100 MHz. There is a spur at the 1st harmonic (20 MHz) with an amplitude of .deltat = 1e-8; fs = 1/deltat; t = 0:deltat:1e-5-deltat; x = cos(2*pi*10e6*t)+3.16e-4*cos(2*pi*20e6*t); r = sfdr(x,fs) r = 70.0063 Display the spectrum of the signal. Annotate the fundamental, the DC value, the spur, and the SFDR.sfdr(x,fs); Minimum Spur DistanceOpen This ExampleObtain the SFDR for a 10 MHz tone with amplitude 1 sampled at 100 MHz. There is a spur at the 1st harmonic (20 MHz) with an amplitude of and another spur at 25 MHz with an amplitude of . Skip the first harmonic by using a minimum spur distance of 11 MHz.deltat = 1e-8; fs = 1/deltat; t = 0:deltat:1e-5-deltat; x = cos(2*pi*10e6*t)+3.16e-4*cos(2*pi*20e6*t)+ ... 0.1e-5*cos(2*pi*25e6*t); r = sfdr(x,fs,11e6) r = 120.0000 Display the spectrum of the signal. Annotate the fundamental, the DC value, the spurs, and the SFDR.sfdr(x,fs,11e6); SFDR from PeriodogramOpen This ExampleObtain the power spectrum of a 10 MHz tone with amplitude 1 sampled at 100 MHz. There is a spur at the 1st harmonic (20 MHz) with an amplitude of . Use the one-sided power spectrum and a vector of corresponding frequencies in Hz to compute the SFDR.deltat = 1e-8; fs = 1/deltat; t = 0:deltat:1e-6-deltat; x = cos(2*pi*10e6*t)+3.16e-4*cos(2*pi*20e6*t); [sxx,f] = periodogram(x,rectwin(length(x)),length(x),fs,'power'); r = sfdr(sxx,f,'power'); Display the spectrum of the signal. Annotate the fundamental, the DC value, the first spur, and the SFDR.sfdr(sxx,f,'power'); Frequency and Power of Largest SpurOpen This ExampleDetermine the frequency in MHz for the largest spur. The input signal is a 10 MHz tone with amplitude 1 sampled at 100 MHz. There is a spur at the first harmonic (20 MHz) with an amplitude of .deltat = 1e-8; t = 0:deltat:1e-6-deltat; x = cos(2*pi*10e6*t)+3.16e-4*cos(2*pi*20e6*t); [r,spurpow,spurfreq] = sfdr(x,1/deltat); spur_MHz = spurfreq/1e6 spur_MHz = 20 SFDR from Time SeriesOpen This ExampleCreate a superposition of three sinusoids, with frequencies of 9.8, 14.7, and 19.6 kHz, in white Gaussian additive noise. The signal is sampled at 44.1 kHz. The 9.8 kHz sine wave has an amplitude of 1 volt, the 14.7 kHz wave has an amplitude of 100 microvolts, and the 19.6 kHz signal has amplitude 30 microvolts. The noise has 0 mean and a variance of 0.01 microvolt. Additionally, the signal has a DC shift of 0.1 volt.rng default Fs = 44.1e3; f1 = 9.8e3; f2 = 14.7e3; f3 = 19.6e3; N = 900; nT = (0:N-1)/Fs; x = 0.1+sin(2*pi*f1*nT)+100e-6*sin(2*pi*f2*nT) ... +30e-6*sin(2*pi*f3*nT)+sqrt(1e-8)*randn(1,N); Plot the spectrum and SFDR of the signal. Display its fundamental and its largest spur. The DC level is excluded from the SFDR computation.sfdr(x,Fs); Related ExamplesSpurious-Free Dynamic Range (SFDR) Measurement