浅析SkipList跳跃表原理及代码实现

article/2025/8/8 0:16:52

转载请注明:http://blog.csdn.net/ict2014/article/details/17394259

SkipList在leveldb以及lucence中都广为使用,是比较高效的数据结构。由于它的代码以及原理实现的简单性,更为人们所接受。我们首先看看SkipList的定义,为什么叫跳跃表?

“     Skip lists  are data structures  that use probabilistic  balancing rather  than  strictly  enforced balancing. As a result, the algorithms  for insertion  and deletion in skip lists  are much simpler and significantly  faster  than  equivalent  algorithms  for balanced trees.   ”

译文:跳跃表使用概率均衡技术而不是使用强制性均衡,因此,对于插入和删除结点比传统上的平衡树算法更为简洁高效。 

我们看一个图就能明白,什么是跳跃表,如图1所示:


                                                                 图1:跳跃表简单示例

如上图所示,是一个即为简单的跳跃表。传统意义的单链表是一个线性结构,向有序的链表中插入一个节点需要O(n)的时间,查找操作需要O(n)的时间。如果我们使用图1所示的跳跃表,就可以减少查找所需时间为O(n/2),因为我们可以先通过每个节点的最上面的指针先进行查找,这样子就能跳过一半的节点。比如我们想查找19,首先和6比较,大于6之后,在和9进行比较,然后在和12进行比较......最后比较到21的时候,发现21大于19,说明查找的点在17和21之间,从这个过程中,我们可以看出,查找的时候跳过了3、7、12等点,因此查找的复杂度为O(n/2)。查找的过程如下图2:


                                                                  图2:跳跃表查找操作简单示例

其实,上面基本上就是跳跃表的思想,每一个结点不单单只包含指向下一个结点的指针,可能包含很多个指向后续结点的指针,这样就可以跳过一些不必要的结点,从而加快查找、删除等操作。对于一个链表内每一个结点包含多少个指向后续元素的指针,这个过程是通过一个随机函数生成器得到,这样子就构成了一个跳跃表。这就是为什么论文“Skip Lists : A Probabilistic Alternative to Balanced Trees ”中有“概率”的原因了,就是通过随机生成一个结点中指向后续结点的指针数目。随机生成的跳跃表可能如下图3所示:


                                                                 图3:随机生成的跳跃表

跳跃表的大体原理,我们就讲述到这里。下面我们将从如下几个方面来探讨跳跃表的操作:

1、重要数据结构定义

2、初始化表

3、查找

4、插入

5、删除

6、随机数生成器

7、释放表

8、性能比较

(一)重要数据结构定义

      从图3中,我们可以看出一个跳跃表是由结点组成,结点之间通过指针进行链接。因此我们定义如下数据结构:

//定义key和value的类型
typedef int KeyType;
typedef int ValueType;//定义结点
typedef struct nodeStructure* Node;
struct nodeStructure{KeyType key;ValueType value;Node forward[1];
};//定义跳跃表
typedef struct listStructure* List;
struct listStructure{int level;Node header;
};
每一个结点都由3部分组成,key(关键字)、value(存放的值)以及forward数组(指向后续结点的数组,这里只保存了首地址)。通过这些结点,我们就可以创建跳跃表List,它是由两个元素构成,首结点以及level(当前跳跃表内最大的层数或者高度)。这样子,基本的数据结构定义完毕了。

(二)初始化表
     初始化表主要包括两个方面,首先就是header节点和NIL结点的申请,其次就是List资源的申请。

void SkipList::NewList(){//设置NIL结点NewNodeWithLevel(0, NIL_);NIL_->key = 0x7fffffff;//设置链表Listlist_ = (List)malloc(sizeof(listStructure));list_->level = 0;//设置头结点NewNodeWithLevel(MAX_LEVEL,list_->header);for(int i = 0; i < MAX_LEVEL; ++i){list_->header->forward[i] = NIL_;}//设置链表元素的数目size_ = 0;
}void SkipList::NewNodeWithLevel(const int& level,Node& node){//新结点空间大小int total_size = sizeof(nodeStructure) + level*sizeof(Node);//申请空间node = (Node)malloc(total_size);assert(node != NULL);
}

其中,NewNodeWithLevel是申请结点(总共level层)所需的内存空间。NIL_节点会在后续全部代码实现中可以看到。

(三)查找

    查找就是给定一个key,查找这个key是否出现在跳跃表中,如果出现,则返回其值,如果不存在,则返回不存在。我们结合一个图就是讲解查找操作,如下图4所示:


                                                       图4:查找操作前的跳跃表

如果我们想查找19是否存在?如何查找呢?我们从头结点开始,首先和9进行判断,此时大于9,然后和21进行判断,小于21,此时这个值肯定在9结点和21结点之间,此时,我们和17进行判断,大于17,然后和21进行判断,小于21,此时肯定在17结点和21结点之间,此时和19进行判断,找到了。具体的示意图如图5所示:


                                                        图5:查找操作后的跳跃表

bool SkipList::Search(const KeyType& key,ValueType& value){Node x = list_->header;int i;for(i = list_->level; i >= 0; --i){while(x->forward[i]->key < key){x = x->forward[i];}}x = x->forward[0];if(x->key == key){value = x->value;return true;}else{return false;}
}

(四)插入

      插入包含如下几个操作:1、查找到需要插入的位置   2、申请新的结点    3、调整指针。

我们结合下图6进行讲解,查找如下图的灰色的线所示  申请新的结点如17结点所示, 调整指向新结点17的指针以及17结点指向后续结点的指针。这里有一个小技巧,就是使用update数组保存大于17结点的位置,这样如果插入17结点的话,就指针调整update数组和17结点的指针、17结点和update数组指向的结点的指针。update数组的内容如红线所示,这些位置才是有可能更新指针的位置。

   

                                                    图6:插入操作示意图(感谢博主:来自cnblogs的qiang.xu )

bool SkipList::Insert(const KeyType& key,const ValueType& value){Node update[MAX_LEVEL];int i;Node x = list_->header;//寻找key所要插入的位置//保存大于key的位置信息for(i = list_->level; i >= 0; --i){while(x->forward[i]->key < key){x = x->forward[i];}update[i] = x;}x = x->forward[0];//如果key已经存在if(x->key == key){x->value = value;return false;}else{//随机生成新结点的层数int level = RandomLevel();//为了节省空间,采用比当前最大层数加1的策略if(level > list_->level){level = ++list_->level;update[level] = list_->header;}//申请新的结点Node newNode;NewNodeWithLevel(level, newNode);newNode->key = key;newNode->value = value;//调整forward指针for(int i = level; i >= 0; --i){x = update[i];newNode->forward[i] = x->forward[i];x->forward[i] = newNode;}//更新元素数目++size_;return true;}
}

(五)删除

    删除操作类似于插入操作,包含如下3步:1、查找到需要删除的结点 2、删除结点  3、调整指针


                                                                             图7:删除操作示意图(感谢博主qiang.xu 来自cnblogs)

bool SkipList::Delete(const KeyType& key,ValueType& value){Node update[MAX_LEVEL];int i;Node x = list_->header;//寻找要删除的结点for(i = list_->level; i >= 0; --i){while(x->forward[i]->key < key){x = x->forward[i];}update[i] = x;}x = x->forward[0];//结点不存在if(x->key != key){return false;}else{value = x->value;//调整指针for(i = 0; i <= list_->level; ++i){if(update[i]->forward[i] != x)break;update[i]->forward[i] = x->forward[i];}//删除结点free(x);//更新level的值,有可能会变化,造成空间的浪费while(list_->level > 0&& list_->header->forward[list_->level] == NIL_){--list_->level;}//更新链表元素数目--size_;return true;}
}

(六)随机数生成器

      再向跳跃表中插入新的结点时候,我们需要生成该结点的层数,使用的就是随机数生成器,随机的生成一个层数。这部分严格意义上讲,不属于跳跃表的一部分。随机数生成器说简单很简单,说难很也很难,看你究竟是否想生成随机的数。可以采用c语言中srand以及rand函数,也可以自己设计随机数生成器。

      此部分我们采用levelDB随机数生成器:

// Copyright (c) 2011 The LevelDB Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. See the AUTHORS file for names of contributors.#include <stdint.h>//typedef unsigned int           uint32_t;
//typedef unsigned long long     uint64_t;// A very simple random number generator.  Not especially good at
// generating truly random bits, but good enough for our needs in this
// package.
class Random {private:uint32_t seed_;public:explicit Random(uint32_t s) : seed_(s & 0x7fffffffu) {// Avoid bad seeds.if (seed_ == 0 || seed_ == 2147483647L) {seed_ = 1;}}uint32_t Next() {static const uint32_t M = 2147483647L;   // 2^31-1static const uint64_t A = 16807;  // bits 14, 8, 7, 5, 2, 1, 0// We are computing//       seed_ = (seed_ * A) % M,    where M = 2^31-1//// seed_ must not be zero or M, or else all subsequent computed values// will be zero or M respectively.  For all other values, seed_ will end// up cycling through every number in [1,M-1]uint64_t product = seed_ * A;// Compute (product % M) using the fact that ((x << 31) % M) == x.seed_ = static_cast<uint32_t>((product >> 31) + (product & M));// The first reduction may overflow by 1 bit, so we may need to// repeat.  mod == M is not possible; using > allows the faster// sign-bit-based test.if (seed_ > M) {seed_ -= M;}return seed_;}// Returns a uniformly distributed value in the range [0..n-1]// REQUIRES: n > 0uint32_t Uniform(int n) { return (Next() % n); }// Randomly returns true ~"1/n" of the time, and false otherwise.// REQUIRES: n > 0bool OneIn(int n) { return (Next() % n) == 0; }// Skewed: pick "base" uniformly from range [0,max_log] and then// return "base" random bits.  The effect is to pick a number in the// range [0,2^max_log-1] with exponential bias towards smaller numbers.uint32_t Skewed(int max_log) {return Uniform(1 << Uniform(max_log + 1));}
};

其中核心的是 seed_ = (seed_ * A) % M这个函数,并且调用一次就重新更新一个种子seed。以达到随机性。

根据个人喜好,自己可以独立设计随机数生成器,只要能够返回一个随机的数字即可。

(七)释放表

      释放表的操作比较简单,只要像单链表一样释放表就可以,释放表的示意图8如下:


                                                                      图8:释放表

void SkipList::FreeList(){Node p = list_->header;Node q;while(p != NIL_){q = p->forward[0];free(p);p = q;}free(p);free(list_);
}

(八)性能比较

  我们对跳跃表、平衡树等进行比较,如下图9所示:


                                                                              图9:性能比较图

从中可以看出,随机跳跃表表现性能很不错,节省了大量复杂的调节平衡树的代码。


========自己开发的源代码,部分参照qiang.xu====================

下面我将自己用C++实现的代码贴出来,总共包含了如下几个文件:

1、Main.cpp 主要用于测试SkipList

2、skiplist.h  接口声明以及重要数据结构定义

3、skiplist.cpp 接口的具体实现

4、random.h  随机数生成器

--------------------------------------Main.cpp----------------------------------------------------

//此文件用于测试skiplist
//
//@作者:张海波
//@时间:2013-12-17
//@版权:个人所有#include "skiplist.h"
#include <iostream>using namespace std;int main(int argc, char** argv)
{cout << "test is starting ....." << endl;SkipList list;//测试插入for(int i = 0; i < 100; ++i){list.Insert(i, i+10);//cout << list.GetCurrentLevel() << endl;}cout << "The number of elements in SkipList is :" << list.size() << endl;if(list.size() != 100){cout << "Insert failure." << endl;}else{cout << "Insert success." << endl;}//测试查找bool is_search_success = true;for(int i = 0; i < 100; ++i){int value;if(!(list.Search(i,value) && (value == i+10))){is_search_success = false;break;}}if(is_search_success){cout << "Search success." << endl;}else{cout << "Search failure." << endl;}//测试删除bool is_delete_success = true;for(int i = 0; i < 100; ++i){int value;if(!(list.Delete(i,value) && (value == i+10))){is_delete_success = false;break;}}if(is_delete_success){cout << "Delete success." << endl;}else{cout << "Delete failure." << endl;}cout << "test is finished ...." << endl;return 0;
}

--------------------------------------------------skiplist.h---------------------------------------------------

//跳表实现
//
//参考文章为:Skip lists: a probabilistic alternative to balanced trees
//
//提供如下接口:
//   Search:搜索给定key的值
//   Insert:插入指定的key及value
//   Delete:删除指定的key
//
//@作者: 张海波
//@时间: 2013-12-17
//@版权: 个人所有
//#include <stddef.h>
#include "random.h"//定义调试开关
#define Debug//最大层数
const int MAX_LEVEL = 16;//定义key和value的类型
typedef int KeyType;
typedef int ValueType;//定义结点
typedef struct nodeStructure* Node;
struct nodeStructure{KeyType key;ValueType value;Node forward[1];
};//定义跳跃表
typedef struct listStructure* List;
struct listStructure{int level;Node header;
};class SkipList{
public://初始化表结构SkipList():rnd_(0xdeadbeef){ NewList(); }//释放内存空间~SkipList(){ FreeList(); }//搜索key,保存结果至value//找到,返回true//未找到,返回falsebool Search(const KeyType& key,ValueType& value);//插入key和valuebool Insert(const KeyType& key,const ValueType& value);//删除key,保存结果至value//删除成功返回true//未删除成功返回falsebool Delete(const KeyType& key,ValueType& value);//链表包含元素的数目int size(){ return size_; }//打印当前最大的levelint GetCurrentLevel();
private://初始化表void NewList();//释放表void FreeList();//创建一个新的结点,结点的层数为levelvoid NewNodeWithLevel(const int& level,Node& node);//随机生成一个levelint RandomLevel();
private:		List list_;Node NIL_;//链表中包含元素的数目size_t size_;//随机器生成器Random rnd_;
};

-------------------------------------------------------------skiplist.cpp-----------------------------------------------------

//skiplist头文件重要函数实现
//
//@作者:张海波
//@时间:2013-12-17
//@版权:个人所有#include "skiplist.h"
#include "time.h"
#include <assert.h>
#include <stdlib.h>
#include <string>
#include <iostream>using namespace std;void DebugOutput(const string& information){
#ifdef Debugcout << information << endl;
#endif
}void SkipList::NewList(){//设置NIL结点NewNodeWithLevel(0, NIL_);NIL_->key = 0x7fffffff;//设置链表Listlist_ = (List)malloc(sizeof(listStructure));list_->level = 0;//设置头结点NewNodeWithLevel(MAX_LEVEL,list_->header);for(int i = 0; i < MAX_LEVEL; ++i){list_->header->forward[i] = NIL_;}//设置链表元素的数目size_ = 0;
}void SkipList::NewNodeWithLevel(const int& level,Node& node){//新结点空间大小int total_size = sizeof(nodeStructure) + level*sizeof(Node);//申请空间node = (Node)malloc(total_size);assert(node != NULL);
}void SkipList::FreeList(){Node p = list_->header;Node q;while(p != NIL_){q = p->forward[0];free(p);p = q;}free(p);free(list_);
}bool SkipList::Search(const KeyType& key,ValueType& value){Node x = list_->header;int i;for(i = list_->level; i >= 0; --i){while(x->forward[i]->key < key){x = x->forward[i];}}x = x->forward[0];if(x->key == key){value = x->value;return true;}else{return false;}
}bool SkipList::Insert(const KeyType& key,const ValueType& value){Node update[MAX_LEVEL];int i;Node x = list_->header;//寻找key所要插入的位置//保存大约key的位置信息for(i = list_->level; i >= 0; --i){while(x->forward[i]->key < key){x = x->forward[i];}update[i] = x;}x = x->forward[0];//如果key已经存在if(x->key == key){x->value = value;return false;}else{//随机生成新结点的层数int level = RandomLevel();//为了节省空间,采用比当前最大层数加1的策略if(level > list_->level){level = ++list_->level;update[level] = list_->header;}//申请新的结点Node newNode;NewNodeWithLevel(level, newNode);newNode->key = key;newNode->value = value;//调整forward指针for(int i = level; i >= 0; --i){x = update[i];newNode->forward[i] = x->forward[i];x->forward[i] = newNode;}//更新元素数目++size_;return true;}
}bool SkipList::Delete(const KeyType& key,ValueType& value){Node update[MAX_LEVEL];int i;Node x = list_->header;//寻找要删除的结点for(i = list_->level; i >= 0; --i){while(x->forward[i]->key < key){x = x->forward[i];}update[i] = x;}x = x->forward[0];//结点不存在if(x->key != key){return false;}else{value = x->value;//调整指针for(i = 0; i <= list_->level; ++i){if(update[i]->forward[i] != x)break;update[i]->forward[i] = x->forward[i];}//删除结点free(x);//更新level的值,有可能会变化,造成空间的浪费while(list_->level > 0&& list_->header->forward[list_->level] == NIL_){--list_->level;}//更新链表元素数目--size_;return true;}
}int SkipList::RandomLevel(){   int level = static_cast<int>(rnd_.Uniform(MAX_LEVEL));if(level == 0){level = 1;}//cout << level << endl;return level;
}int SkipList::GetCurrentLevel(){return list_->level;
}

-----------------------------------------------------------random.h-------------------------------------------------------

// Copyright (c) 2011 The LevelDB Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. See the AUTHORS file for names of contributors.#include <stdint.h>//typedef unsigned int           uint32_t;
//typedef unsigned long long     uint64_t;// A very simple random number generator.  Not especially good at
// generating truly random bits, but good enough for our needs in this
// package.
class Random {private:uint32_t seed_;public:explicit Random(uint32_t s) : seed_(s & 0x7fffffffu) {// Avoid bad seeds.if (seed_ == 0 || seed_ == 2147483647L) {seed_ = 1;}}uint32_t Next() {static const uint32_t M = 2147483647L;   // 2^31-1static const uint64_t A = 16807;  // bits 14, 8, 7, 5, 2, 1, 0// We are computing//       seed_ = (seed_ * A) % M,    where M = 2^31-1//// seed_ must not be zero or M, or else all subsequent computed values// will be zero or M respectively.  For all other values, seed_ will end// up cycling through every number in [1,M-1]uint64_t product = seed_ * A;// Compute (product % M) using the fact that ((x << 31) % M) == x.seed_ = static_cast<uint32_t>((product >> 31) + (product & M));// The first reduction may overflow by 1 bit, so we may need to// repeat.  mod == M is not possible; using > allows the faster// sign-bit-based test.if (seed_ > M) {seed_ -= M;}return seed_;}// Returns a uniformly distributed value in the range [0..n-1]// REQUIRES: n > 0uint32_t Uniform(int n) { return (Next() % n); }// Randomly returns true ~"1/n" of the time, and false otherwise.// REQUIRES: n > 0bool OneIn(int n) { return (Next() % n) == 0; }// Skewed: pick "base" uniformly from range [0,max_log] and then// return "base" random bits.  The effect is to pick a number in the// range [0,2^max_log-1] with exponential bias towards smaller numbers.uint32_t Skewed(int max_log) {return Uniform(1 << Uniform(max_log + 1));}
};

上述程序运行的结果如下图所示:



http://chatgpt.dhexx.cn/article/M8RqtfQ7.shtml

相关文章

跳表(skiplist)的理解

听到跳表(skiplist)这个名字,既然是list,那么应该跟链表有关。 跳表是有序链表,但是我们知道,即使对于排过序的链表,我们对于查找还是需要进行通过链表的指针进行遍历的,时间复杂度很高依然是O(n),这个显然是不能接受的。是否可以像数组那样,通过二分法进行查找呢,但…

SkipList详解

本文参考&#xff1a;《大数据日知录》 概念 SkipList是一种用来代替平衡树的数据结构。 虽然在最坏的情况下SkipList的效率要低于平衡树&#xff0c;但是大多数情况下效率仍然非常高&#xff0c;其插入、删除、查找的时间复杂度都是O(log(N))。 除了高效外&#xff0c;其实现…

跳表(skipList)

一、为何有skipList这种数据结构的出现 我们知道二分查找算法之所以能达到 O(logn) 这样高效的一个重要原因在于它所依赖的数据结构是数组&#xff0c;数组支持随机访问一个元素&#xff0c;通过下标很容易定位到中间元素。而链表是不支持随机访问的&#xff0c;只能从头到尾依…

跳表 skiplist 简介

跳表 skiplist 跳表 (Skip List) 是由 William Pugh 在 1990 年发表的文章 Skip Lists: A Probabilistic Alternative toBalanced Trees 中描述的一种查找数据结构&#xff0c;支持对数据的快速查找&#xff0c;插入和删除。 对于 AVL 树、红黑树等平衡树&#xff0c;在插入过…

SkipList(跳跃表)详解

Introduction: skiplist本质上也是一种查找结构&#xff0c;用于解决算法中的查找问题&#xff08;Searching&#xff09;&#xff0c;即根据给定的key&#xff0c;快速查到它所在的位置&#xff08;或者对应的value&#xff09; 一般用于解决查找问题的数据结构分为两个大类…

docker中国镜像

一,如果是像redis,mysql等官方的镜像,直接配置阿里云的镜像就可以 1,注册阿里云账号,并登录 2,打开这个网址 https://cr.console.aliyun.com/cn-hangzhou/instances/mirrors 3,页面上会教怎么设置,如下面的截图 二,如果是私有仓库的镜像 非常感谢原作者:https://www.jiansh…

Docker 使用国内镜像仓库

Docker 使用国内镜像仓库 1、问题描述2、总结 1、问题描述 由于某些原因&#xff0c;导致Docker镜像在国内下载速度特别慢。所以为了沉浸式开发。最好切换为国内源。这里以163 的镜像仓库举例。首先修改/etc/docker/daemon.json配置文件。 sudo vi /etc/docker/daemon.json…

MacOS上配置docker国内镜像仓库地址

背景 docker官方镜像仓库网速较差&#xff0c;我们需要设置国内镜像服务 我的MacOS docker版本如下 设置docker国内镜像仓库地址 点击Settings点击Docker Engine修改配置文件&#xff0c;添加registry-mirrors {"builder": {"gc": {"defaultKeepS…

Docker国内镜像加速地址与详细说明

简介 对于动不动就几百M甚至上G的Docker镜像来说&#xff0c;官方镜像总是掉线或速度极慢&#xff0c;为了改善这种情况&#xff0c;建议切换成国内镜像。常用的国内镜像使用阿里云、网易的居多&#xff0c;本篇内容将记录一下Docker的这些国内镜像是怎么使用的。 国内常用的…

Docker国内镜像

1、下面这些镜像实测基本都用不了。 网易镜像中心&#xff1a;http://hub-mirror.c.163.com daocloud镜像市场&#xff1a;https://hub.daocloud.io 七牛云&#xff1a;https://reg-mirror.qiniu.com Azure&#xff1a;https://dockerhub.azk8s.cn 中科大: https://docke…

docker 国内镜像配置

一、常用镜像地址 1、中国科技大学:https://docker.mirrors.ustc.edu.cn 2、阿里云:https://cr.console.aliyun.com/ 3、Docker中国区官方镜像:https://registry.docker-cn.com 4、网易:http://hub-mirror.c.163.com 5、ustc:https://docker.mirrors.ustc.edu.cn 6、daoclo…

window docker国内镜像设置

刚开始使用的时候&#xff0c;发现因为网络的问题&#xff0c;经常出现镜像下载失败的情况。如下图所示。 这是应为docker服务在国外,直接访问会因为网络原因失败或者特别慢,因此我们可以将将镜像源设置为国内的。 一. 在桌面右下角出有一个docker的图标,鼠标右键点击setings,…

【Docker】Docker 设置国内镜像源_docker国内镜像库

文章目录 1. Docker阿里云镜像加速2. 参考资料 点击跳转&#xff1a;Docker安装MySQL、Redis、RabbitMQ、Elasticsearch、Nacos等常见服务全套&#xff08;质量有保证&#xff0c;内容详情&#xff09; 1. Docker阿里云镜像加速 在国内&#xff0c;从官方的Docker Hub仓库拉取…

docker构建国内镜像服务

在国内想要下载镜像比较困难&#xff0c;因此很多公司都构建自己的私有仓库。如何搭建私有仓库&#xff0c;请参考《docker私有仓库从无到有》。然而即使私有仓库服务构建完成&#xff0c;但是里面没有镜像&#xff0c;一样很苦恼。今天介绍一下如何利用国内云服务商提供的镜像…

电网电压的三相静止对称坐标系和三相电网电压的相量表示法

电网电压的空间电压矢量和电网电压的相量表示这两个概念需要区分清楚。分别参考邱关源的《电路》和张兴的《PWM整流》相关章节。 图2 三相电网电压的相量表示法 电网电压的相量表示&#xff0c;三相相差120度&#xff0c;整体逆时针50HZ旋转&#xff0c;这里的120度是指三分之一…

交流电中为什么要用相量法?

上两节课,电工学了电流和电压的相量表示法,对于复数的引入感觉稀里糊涂的,于是去搜了知乎,一篇文章让我恍然大悟,如果也有不理解的小伙伴可以复制这个,去知乎看详细解答嗷~ https://www.zhihu.com/question/347763932/answer/1103938667 下面👇是我的理解➕概括总结:…

斯泰因梅茨-电路向量法的创始人

施泰因梅茨&#xff08;Steinmetz&#xff0c;Charles Protells&#xff09;德裔美国电机工程师。美国艺术与科学学院院士。1865年4月9日生于德国的布雷斯劳&#xff08;今波兰的弗罗茨瓦夫&#xff09;。1901 &#xff5e;1902 年任美国电机工程师学会主席。1889年迁居美国。他…

相量法

复数 代数形式 三角形式 指数形式 极坐标形式 正弦量 的三要素 峰值&#xff0c;峰峰值 角速度、频率、周期 初相 有效值即 相位差 相量法的基础 则 则 电路定律的相量形式 则 则 则

数字正交下变频(多相滤波法)

[TOC] 多相滤波原理 在上一篇文章中讨论了基于低通滤波方式的正交下变频系统。下面是该种方式的结构图。 图1.1 数字正交下变频 但是,这种典型的数字下变频方式也存在着这样一些缺陷: * 当采样信号为宽带信号时,需要较高的采样频率,此时会带来系统设计的复杂度; * 先滤…