[skill seconds get] how to use MATLAB to make a mif file

Here to explain the realization of a 16384 (2^14) point 14-bit sine wave data mif format file generation, using this file, we can generate a standard sine wave on the FPGA based on the principle of direct digital synthesis (DDS), that is to achieve the signal The function of the generator.

For the related content of the DDS principle, please refer to Chapter 6 Section 6.2 - "Dual Channel Amplitude-Frequency Adjustable DDS Signal Generator" in "FPGA Self-Study Notebook - Design and Verification" published by Beihang Press. Content.

Before long ago, I had written a method to generate a 1024-point 16-bit sine wave mif file, but at that time my matlab technology was particularly special dish (now it is also a dish), but simply implemented a sine wave in matlab The generation of data, about rounding and rounding and the final generation of mif files, I used excel and quartus two software after a complicated operation to finally complete.

Today, he himself has no patience with that method. A new dual-channel, 14-bit high-speed DAC module needs 14-bit mif data when doing DDS experiments. Therefore, the matlab script file is rewritten today. The function of generating a mif file by one key can be realized only through Matlab.

First, open the MATLAB software. The version used here is MATLAB 2012b. Create a new script file, the operation is File -> New -> Script. Enter the following in this file:

F1=1; frequency of % signal

Fs=2^14; % sampling frequency

P1 = 0; % signal initial phase

N=2^14; % sampling points are N

t=[0:1/Fs:(N-1)/Fs]; % sampling time

ADC=2^13 - 1;% DC Component

A=2^13; % signal amplitude

s=A*sin(2*pi*F1*t + pi*P1/180) + ADC; % generates signal

Plot(s);% Drawing graphics

Fild = fopen('d:/sin14bit_16384.mif','wt');% Create a mif file

% write mif file header

Fprintf(fild, '%s','WIDTH=14;'); %bit width

Fprintf(fild, '%s','DEPTH=16384;');% depth

Fprintf(fild, '%s','ADDRESS_RADIX=UNS;'); %address format

Fprintf(fild, '%s','DATA_RADIX=HEX;'); %Data Format

Fprintf(fild, '%s','CONTENT');% address

Fprintf(fild, '%s','BEGIN');%

For i = 1:N

S2(i) = round(s(i)); % rounding decimals to rounding

If s2(i) < 0 % forces a negative 1 to be set to 0

S2(i) = 0

End

% addr : data;

Fprintf(fild, '%g',i-1);% address, encoded from 0

Fprintf(fild, '%s',':');

Fprintf(fild, '%x',s2(i));

Fprintf(fild, '%s', ';');

End

If you want to generate other depth and bit width data yourself, you only need to modify the sampling frequency (Fs), sampling points (N), DC components (ADC), and signal amplitude (A).

Save the file, click the Run button, you can generate the sine wave data we need, and generate a file named "sin14bit_16384.mif" in the root directory of the D drive of the computer.

[skill seconds get] how to use MATLAB to make a mif file

Then, the interface shown in Figure 1 will pop up. The interface is based on the data we produce. The waveform t is plotted on the time axis. The waveform is known as the standard sine wave. You can also zoom in and out. Look at the values ​​of several vertices to determine if the data is within its intended range. Here, we simply turn off the interface.

Figure 2 shows the DDS signal generator system designed using this file. The output frequency is 3.448Mhz (a randomly set value). The FFT function of the oscilloscope shows that the harmonics are not large.

[skill seconds get] how to use MATLAB to make a mif file

[skill seconds get] how to use MATLAB to make a mif file

Micro Vibration Motor

The micro Vibration Motor is introduced:

Micro vibration motor is mainly used for adult health care products and toys, micro vibration motor is a Dc Motor, the motor shaft with an eccentric wheel, the use of most of the micro vibration motor voltage is lower than 6 v, probably between 6 mm to 15 mm in diameter, when the motor rotation, eccentric circle particles is not the core of the motor, the motor often lose their balance, due to the inertia effect.



Characteristics: small volume, strong vibration;


Features: small size, fast speed, stable performance, low price, can use battery drive,Can change the different materials of the pendulum head
Vibration Motor Vibration Motor
Method of use: the best stable in horizontal plane, installed on the dc Micro vibration motor output shaft parts, cannot use a hammer to knock, knock prone to press into the Micro vibration motor drive, may cause damage to internal components, and cannot be used in the case of blocked.

vibration motor

Operating temperature range:

Mini Vibration Motor should be used at a temperature of -10~60℃.

The figures stated in the catalog specifications are based on use at ordinary room temperature catalog specifications re based on use at ordinary room temperature (approximately20~25℃.

If a Mini Vibration Motor is used outside the prescribed temperature range,the grease on the gearhead area will become unable to function normally and the motor will become unable to start.Depending on the temperature conditions ,it may be possible to deal with them by changing the grease of the motor's parts.Please feel free to consult with us about this.


Storage temperature range:

Mini Vibration Motor should be stored ta a temperature of -15~65℃.

In case of storage outside this range,the grease on the gearhead area will become unable to function normally and the motor will become unable to start.


Service life:

The longevity of Mini Vibration Motor is greatly affected by the load conditions , the mode of operation,the environment of use ,etc.Therefore,it is necessary to check the conditions under which the product will actually be used .The following conditions will have a negative effect on longevity.Please consult with us should any of them apply.


●Use with a load that exceeds the rated torque

●Frequent starting

●Momentary reversals of turning direction

●Impact loads

●Long-term continuous operation

●Forced turning using the output shaft

●Use in which the permitted overhang load or the permitted thrust load is exceeded

●A pulse drive ,e.g.,a short break,counter electromotive force,PWM control

●Use of a voltage that is nonstandard as regards the rated voltage

●Use outside the prescribed temperature or relative-humidity range,or in a special environment.

●Please consult with us about these or any other conditions of use that may apply,so that we can be sure that you select the most appropriate model.


when it come to volume production,we're a major player as well .each month,we rurn out 600000 units,all of which are compliant with the rohs directive.Have any questions or special needed, please contact us, we have the engineer group and best sales department to service to you Looking forward to your inquiry. Welcome to our factory.

vibration motor

Micro Vibration Motor,Mini Vibration Motor,Dc Micro Vibration Motor,Electric Micro Vibration Motor

Shenzhen Shunchang Motor Co., LTD. , https://www.scgearmotor.com